Introduction
TortoiseSVN is a mature and complete product that provides some useful features like comparison of non text based files like Word, PowerPoint, Excels and images files.
The TortoiseHg hasn't this feature so you can't, for example, visual compare Word files. Nevertheless we can configure TortoiseHg in a way that it can use the comparison features of TortoiseSVN. In this post I will choose you how to do such configuration.
Create an the invoke-tortoisesvn-diff.cmd
First of all we create a command that will invoke TortoiseSVN Diff.
Create a file named invoke-tortoisesvn-diff.cmd with the code:
SET LEFT=%1
SET RIGHT=%2
SET PROC=C:\Program Files\TortoiseSVN\bin\TortoiseProc.exe
"%PROC%" /command:diff /path:%LEFT% /path2:%RIGHT%
Place it when you want, for example in C:\Program Files\TortoiseHg.
Before continuing test the command, for example comparing two word files:
invoke-tortoisesvn-diff.cmd C:\path\to\left\document.doc C:\path\to\right\document.doc
Using absolutes path is essential.
Integrate invoke-tortoisesvn-diff in TortoiseHg
Next we tells to TortoiseHg to use this command editing the mercurial.ini.
Placed in C:\Documents and Settings\<user>\mercurial.ini.
And add the followings::
[extdiff]
cmd.tortoise_svn_diff = C:\Program Files\TortoiseHg\invoke-tortoisesvn-diff.cmd
Now we can test the integration with TortoiseHG. From a mercurial working directory do right click > TortoiseHG... > Visual Diff and the usual "Visual Diffs" window should be displayed.
From the tools dropdown list choose tortoise_svn_diff and then double click the document name and the differences should be shown in a new word document.