Image processing (bmp, png, jpg, etc.) Conflicts of merging files in mercurial

At a minimum, I would like hg merge to open conflicting versions in side instances, say in MS Paint (ugh), so I can do the merge manually. Bonus points for tool offers other than MS Paint. I'm currently watching Araxis Merge .

+4
source share
4 answers

See the mercurial tool configuration page on the Mercurial wiki. You can force Mercurial to run a special merge tool based on the file extension.

Araxis tool looks cool, but I have no experience with it (I use Linux). If this does not work for you, I will instead make a small script that displays all three images (the base version and two conflicting versions) and allows you to choose the β€œwinner”.

+2
source

You could have uuencode or base64-encoded images (you can set the hooks for automatic conversion), so you don't have to deal with binary files when merging. However, merging usually works on strings, not characters, and I'm not as efficient as enocding usually does not contain new lines.

0
source

The Araxis Merge website claims to integrate with Mercurial . The product is commercial, so if you have a license that you might want to find in order to get information about using your product with Mercurial.

If you do not have a license and want to use your product, they are likely to help you get a demo. Then you can mock the problem with fake repositories and test it all ...

If you are trying to leave Commercial, then manually configuring the merge tools based on each file is the only way. I do not know about any open source programs or free paint that would support merging. As a stand for MS Paint, you can probably configure Paint.net to work with Mercurial (manually).

0
source

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.
0
source

All Articles