getting WinMerge to work as diff tool

Mar 1, 2011 at 12:13 AM

I was excited to try out the External Diff Tool Command but I hit a snag.

I'm using the basic template given for  the diff tool ( I only modified file location for WinMerge)

"F:\Program Files (x86)\WinMerge\WinMergeU.exe" -e -x -u -wl -dl "$(BaseName)" -dr "$(MineName)" "$(base)" "$(mine)"

but when WinMerge dialog comes up it is trying to compare:

Left:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\$(base)

Right:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\$(mine)

Any ideas?

p.s. KDiff3 worked when I picked that as a template

Mar 1, 2011 at 12:18 AM

I found the bug.  Should be capitals

"$(ProgramFiles)\WinMerge\WinMergeU.exe" -e -x -u -wl -dl "$(BaseName)" -dr "$(MineName)" "$(base)" "$(mine)"

becomes:

"$(ProgramFiles)\WinMerge\WinMergeU.exe" -e -x -u -wl -dl "$(BaseName)" -dr "$(MineName)" "$(Base)" "$(Mine)"

Maybe someone familiar with the codeset can check in the change.

Looks like WinMerge is the only bad one :)

 

Mar 1, 2011 at 12:24 AM

Hmm.. I'm going crazy.. I thought I saw it work once, but now I'm not having any luck.

Switching back to kDiff3

Mar 1, 2011 at 3:45 AM

I didn't have much luck getting it to work with Beyond Compare or CodeCompare either. Kdiff3 works fine. I didn't have time to mess about much so I'll look into it further soon.

Coordinator
Mar 1, 2011 at 4:01 PM
Edited Mar 1, 2011 at 4:12 PM

@derek_penguin

The following template should work for WinMerge.

"$(ProgramFiles)\WinMerge\WinMergeU.exe"  "$(Base)" "$(Mine)"

 ... and yes, the capitals was not correct - I changed and tested that and it also works now.

"$(ProgramFiles)\WinMerge\WinMergeU.exe" -e -x -u -wl -dl "$(BaseName)" -dr "$(MineName)" "$(Base)" "$(Mine)"

Here you will find more infos about WinMerge command line

http://manual.winmerge.org/Version_control.htm

@CadBloke

CodeCompar works fine on my machine with the given template, Beyond Compare I have never tested.

 

If you have better templates let me know.

Regards, Bernd

Mar 1, 2011 at 4:42 PM

Thanks Bernd!

FYI I had to use:

"$(ProgramFiles (x86))\WinMerge\WinMergeU.exe"  "$(Base)" "$(Mine)"

 

Mar 6, 2011 at 10:57 PM

@Bernd - I must have done something silly on my #2 laptop. Both Beyond Compare & CodeCompare work perfectly on my dev laptop, as does Tortoise V2. All with VS 2010 SP1.

Nice one.

cheers

Ewen

Mar 26, 2011 at 1:34 AM

I restarted Visual Studio 2010 after configuring the diff tool and the Diff took a couple times to get WinMerge to load, but now it all works OK. This is awesome, thanks Dev Team.

Jan 21, 2014 at 5:34 PM
I've created my own solution to this. Unfortunately it involves replacing KDIFF3.EXE in the TortoiseHG directory but since I don't use KDIFF3, it doesn't matter all that much to me.

The code needs to be compiled, there's a Visual Studio 2013 project here:

Mercurial:
https://lassevk.kilnhg.com/Code/KDiff3Lookalike/proto/trunk

Git:
https://lassevk.kilnhg.com/Code/KDiff3Lookalike/proto/trunk.git

You need to clone/fork this, build the project, then copy these two files:

KDiff3.exe
KDiff3.exe.config

from the bin\Debug or bin\Release folder to your TortoiseHG folder, replacing KDiff3.exe that is already there (you should rename the old file first).

If you don't have Beyond Compare 3 installed in the default location, or want to use a different tool, you need to edit the KDiff3.exe.config file to specify the path to the executable and the format of its command line options.