How to patch a module’s internal functions with mock?

The answer: Clean up your darned imports @patch(‘mymodule.TAX_LOCATION’, ”) did indeed patch things appropriately, but since our imports at the time were very haphazard — sometimes we imported mymodule.build_cart, sometimes we imported project.mymodule.build_cart — instances of the “full” import were not patched at all. Mock couldn’t be expected to know about the two separate import … Read more

How to read patch .rej files

A simple example: $ echo -e “line 1\nline 2\nline 3” > a $ sed -e ‘s/2/b/’ <a >b $ sed -e ‘s/2/c/’ <a >c $ diff a b > ab.diff $ patch c < ab.diff $ cat c.rej *************** *** 2 – line 2 — 2 —– + line b As you can see: The … Read more

I don’t “get” how a program can update itself. How can I make my software update?

Usually the process is as follows: the user starts the applicataion the application launches an “updater” (another program) the updater retrieves from the Internet if a newer version exists if that’s the case, propose the user to update the users accepts, the updater downlads the new install package (that can be incremental) the updater shuts … Read more

Including new files in SVN diff

To make svn diff include all the unversioned files from your local working copy you have to add these files first. svn diff outputs the same changeset that svn commit would use. If you know for sure that all unversioned files should be added here’s what you could do. Prepare a list of unversioned files … Read more

Git: How to create patches for a merge?

There does not seem to be a solution producing individual commits à la git format-patch, but FWIW, you can format a patch containing the effective merge commit, suitable/compatible with git am: Apparently, the Git Reference guide provides the first hint: git log -p show patch introduced at each commit […] That means for any commit … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)