cannot set diff and merge tool when names share the same prefix
Created originally on Bitbucket by Anonymous
I work on the development of SimDiff4, a diff and merge tool for Simulink models.
The tool requires passing arguments before each file path. That is, to compare 2 files it should be called as follows: simdiff4 -l <file_path_1> -r <file_path_2>
I cannot configure such a diff tool in TortoiseHg since I cannot insert the -l and -r options right before the file paths. See the following text from http://mercurial.selenic.com/wiki/ExtdiffExtension that says:
*Each custom diff commands can have two parts: a 'cmd' and an 'opts' part. The cmd.xxx option defines the name of an executable program that will be run, and opts.xxx defines a set of **command-line options which will be inserted to the command between the program name and the files/directories to diff** (i.e. the cdiff example above).*
Therefore, I decided to use a wrapper called toolselector to compare files that calls simdiff4 with proper arguments.
Since I use simdiff4 tool to merge files, I came with the following configuration options:
[extensions]
hgext.extdiff =
[extdiff]
cmd.simdiff4_diff = C:\Program Files\EnSoft\SimDiff 4_2_1\utils\toolselector-20120215-1803\toolselector.exe
opts.simdiff4_diff = -profile=mercurial_sd4
[merge-patterns]
**.mdl = simdiff4
**.slx = simdiff4
[merge-tools]
simdiff4.executable = C:\Program Files\EnSoft\SimDiff 4_2_1\simdiff4.exe
simdiff4.args = -b $base -l $local -r $other -o $output
simdiff4.binary = true
simdiff4.gui = true
As seen above, I named the diff tool simdiff4_diff and the merge tool simdiff4 I found TortoiseHg fails to invoke toolselector to compare files. If I name the merge tool simdiff4_merge in the config file then it all works as expected. That is:
[merge-patterns]
**.mdl = simdiff4_merge
**.slx = simdiff4_merge
[merge-tools]
simdiff4_merge.executable = C:\Program Files\EnSoft\SimDiff 4_2_1\simdiff4.exe
simdiff4_merge.args = -b $base -l $local -r $other -o $output
simdiff4_merge.binary = true
simdiff4_merge.gui = true
My conclusion is that the problem occurs when name for diff and merge tool is same (I also observed this) or one is a prefix of the other (case explained above). Could you confirm this is a bug?