Here is an easy way to configure Mercurial to enable image merging using MS Paint.
First, create the mspaintmergetool.cmd file somewhere on the Windows PATH system (so that Mercurial can find it), containing:
START %WINDIR%\system32\mspaint.exe %1 START %WINDIR%\system32\mspaint.exe %2 START %WINDIR%\system32\mspaint.exe %3 START /WAIT %WINDIR%\system32\mspaint.exe %4
Then configure Mercurial to merge the images using this script, adding the following to your .hgrc or mercurial.ini :
[merge-tools] mspaintmergetool.args = $base $local $other $output mspaintmergetool.binary = True [merge-patterns] **.bmp = mspaintmergetool **.png = mspaintmergetool **.jpg = mspaintmergetool
If during the merge the image named cat.png conflicts, four instances of MS Paint will open:
cat.png~base is what the image looked just before the development split into two streams that you are trying to merge back now.cat.png~orig - this is how the image looks in the branch with which you merge (aka local); This is the image that you started working in your working directory before starting this merge.cat.png~other - this is what the image looks like in the branch you are leaving (aka remote)cat.png - when this Paint instance is opened, it first contains the same image as ~orig ; your task is to edit the image in this instance in a combination of ~orig and ~other , save and exit this Paint instance. Upon exit, Mercurial will mark the conflict as resolved and resume the merge. Please note that the first three instances will not close automatically, so to avoid confusion with the potential remaining conflicting images, you can manually close these Paint instances before closing this one.
source share