WinMerge configuration when called from TortoiseHG/Mercurial

289 views Asked by At

Summary:

When TortoiseHG/Mercurial calls WinMerge, it appears to pass as standard the /e command line parameter. How do I configure it so that command line parameter is not passed?

Details:

I'm using TortoiseHG(2.10.1) and WinMerge (2.14.0) on Windows 7. The mercurial global settings are configured to use WinMerge for both vdiff and merging.

When WinMerge is called, the /e command line parameter means that the Esc key closes WinMerge on the first press.

My problem is that when I double click on a file in the list of changes files in WinMerge, it opens a new tab, and clicking Esc closes WinMerge, not just the individual file comparison tab. I want to be able to press Esc key to close just the individual file comparison tab... and from what I can tell, removing the /e will do that.

Unfortunately I can't work out how to get the configuration file to do that.

Here is my configuration file as I currently have it...

[ui]
username = {removed for StackOverflow}
merge = winmergeu

[tortoisehg]
vdiff = winmergeu
initialrevision = workingdir

[extdiff]
cmd.winmerge= C:\Program Files\WinMerge\WinMergeU.exe
opts.winmerge= /x /ub /wl

[extensions]
hgext.convert=
mercurial_keyring=
mq=
rebase = 

[web]

I have also tried changing the cmd.winmerge and opts.winmerge to use winmergeu


Additional:

I have also just tried adding hgext.extdiff= to the [extensions] section, as well as the following... but still no luck.

[merge-tools]
winmerge.regkey=Software\Thingamahoochie\WinMerge\
winmerge.regname=Executable
winmerge.priority=-10
winmerge.args=/x /wl /ub /dl other /dr local $other $local $output
winmerge.fixeol=True
winmerge.checkchanged=True
winmerge.gui=True
winmerge.diffargs=/r /x /ub /wl /dl '$plabel1' /dr '$clabel' $parent $child
winmerge.diff3args=
winmerge.dirdiff=True

(This information came from this blog)

1

There are 1 answers

1
StayOnTarget On

Edit the file C:\Program Files\TortoiseHg\defaultrc\MergeTools.rc.

It has a WinMerge section which looks like this:

winmergeu.args=/e /x /u /wl /wr /dl local /dr other $local $output $other
winmergeu.checkchanged=True
winmergeu.diff3args=/r /e /x /u /wl /wr /dl '$plabel1' /dm '$clabel' /dr '$plabel2' $parent1 $child $parent2
winmergeu.diffargs=/r /e /x /u /wl /dl '$plabel1' /dr '$clabel' $parent $child
...

Indeed the /e option is present on lines 1, 3, 4 which seem to be the options used for 3-way merge, 3-way diff, and 2-way diff, respectively.

After editing (as admin) to remove the /e option, restart THG Workbench.

If you have trouble debugging what is going on you can use a tool like Process Explorer to inspect the actual command line passed to a running WinMerge process. (Find winmerge.exe in the process list and view its properties).

I must say that I don't really like editing files under Program Files, but I have not found another way to do this.

I've tried this with THG 6.3.2.