R – Using WinMerge with Bazaar

bazaarwinmerge

I searched a lot, found that some people claimed they did that, but I can't make it to work.

How to you use WinMerge, my favorite diff tool on Windows, with Bazaar?

I know difftools plugin (shipped with Bazaar) handles this but the controller.py file doesn't list it, and I fail to see where to specify a path. Looks like it searches in PATH variable, and reports bzr: ERROR: Cannot find 'winmerge' in (long list of paths).
I tried to put a .cmd file, then a shortcut to WinMergeU.exe in Bazaar's directory, renaming accordingly (winmerge.cmd, winmerge.lnk) the register_diff_tool parameter. No more error, but nothing is launched…

So, does somebody has any success using WinMerge (or perhaps some other Windows tool) with Bazaar?

I would be interested to use it with extmerge plugin too…


EDIT After the first two answers, I tried some variants which I list here for reference. None worked:

# As suggested:
# Bad: bzr: ERROR: [Errno 22] Invalid argument: 'c:\\docume~1\\philho\\locals~1\\temp\\bzr_C:/Program Files/_Text/WinMerge/WinMergeU.exeh7angm.log'
wdiff = diff --using "C:/Program Files/_Text/WinMerge/WinMergeU.exe"
# Bad: bzr: ERROR: Cannot find 'C:Progra~1_TextWinMergeWinMergeU.exe' in <PATH>
wdiff = diff --using C:\Progra~1\_Text\WinMerge\WinMergeU.exe

# Variants:
# Bad: bzr: ERROR: [Errno 22] Invalid argument: 'c:\\docume~1\\philho\\locals~1\\temp\\bzr_C:/Progra~1/_Text/WinMerge/WinMergeU.exejuttft.log'
wdiff = diff --using C:/Progra~1/_Text/WinMerge/WinMergeU.exe
# Bad: bzr: ERROR: [Errno 22] Invalid argument: 'c:\\docume~1\\philho\\locals~1\\temp\\bzr_C:\\Program Files\\_Text\\WinMerge\\WinMergeU.exehpabjl.log'
wdiff = diff --using "C:\\Program Files\\_Text\\WinMerge\\WinMergeU.exe"
# Bad: bzr: ERROR: [Errno 22] Invalid argument: 'c:\\docume~1\\philho\\locals~1\\temp\\bzr_C:\\Progra~1\\_Text\\WinMerge\\WinMergeU.exe4gi5or.log'
wdiff = diff --using C:\\Progra~1\\_Text\\WinMerge\\WinMergeU.exe

Using:

Bazaar (bzr) 1.11
  Python interpreter: C:\Program Files\_Dev\Bazaar\python25.dll 2.5.2

Actually, the awful (and embarrassing) truth is that it appears that one of my earlier attempts worked, but I saw nothing… because I was testing against a committed file! I suppose I was expecting that by default it compared last two revisions or something.

Anyway, as I wrote in a comment, I don't want to put WinMerge directory in my already too long path, so I took at middle road, making a command file and putting it in Bazaar's directory which is already in the path.
At least it works, and I can easily add parameters if needed.

[ALIASES]
wdiff = diff --using winmerge.cmd

# winmerge.cmd contains:
"C:\Program Files\_Text\WinMerge\WinMergeU.exe" %1 %2

Maybe I should put that as solution in the thread, although it lacks elegance.

For the record, while we are on the topic of external tools, I also added to bazaar.conf:

editor = C:/Program Files/_Text/SciTE/SciTE.exe

It is used by commit (without -m option), for example.

Next step: extmerge. Looking closer, it doesn't seem WinMerge is usable there, not having 3-way merge. I might use Perforce's merge, it is free and I am used to it.
Just a note for those as confused as me: extmerge isn't a GUI replacement for merge. If you run it, it will report no conflict, even if merge reports them. Actually, you have to run merge first, then extmerge to use the generated/altered files and do the job…
If you want to use WinMerge anyway, perhaps to compare OTHER to THIS, you can use:

external_merge = "C:/Program Files/_Text/WinMerge/WinMergeU.exe %o %t %r"

I hope my attempts/remarks here will be useful to some other people… 🙂

[UPDATE]
Oookaaay!
So I was confused! A message in the Bazaar mailing list enlightened my poor soul:
"You know that bzr also provides diff –using, right? You prefer the version in difftools?" — Aaron Bentley, 2009-04-03 in Re: difftools, ‘bzr diff –using footool’, and ‘diffuse’

Aargh! No, I didn't know that.
I removed difftools plugin, edited my line to:

wdiff = diff --using "C:/Program Files/_Text/WinMerge/WinMergeU.exe"

and it worked perfectly fine, out of the box! I am not sure why this difftools plugin isn't marked as obsolete.

I leave this question as a reference in case other newbies like me are confused too. And I can at least elect an answer. Thanks!

Best Answer

bzr diff --using "C:/Program Files/WinMerge/WinMergeU.exe"

You can add this to aliases in bazaar.conf

Or, if you have C:\Program Files\WinMerge in your PATH environment variable you can use it as:

bzr diff --using WinMergeU.exe