@@ -26,7 +26,9 @@
# add new command called vdiff, runs kdiff3
vdiff = kdiff3
- # add new command called meld, runs meld (no need to name twice)
+ # add new command called meld, runs meld (no need to name twice). If
+ # the meld executable is not available, the meld tool in [merge-tools]
+ # will be used, if available
meld =
# add new command called vimdiff, runs gvimdiff with DirDiff plugin
@@ -63,7 +65,7 @@
from mercurial.i18n import _
from mercurial.node import short, nullid
-from mercurial import cmdutil, scmutil, util, commands, encoding
+from mercurial import cmdutil, scmutil, util, commands, encoding, filemerge
import os, shlex, shutil, tempfile, re
cmdtable = {}
@@ -279,7 +281,9 @@
if cmd.startswith('cmd.'):
cmd = cmd[4:]
if not path:
- path = cmd
+ path = util.findexe(cmd)
+ if path is None:
+ path = filemerge.findexternaltool(ui, cmd) or cmd
diffopts = ui.config('extdiff', 'opts.' + cmd, '')
diffopts = diffopts and [diffopts] or []
elif cmd.startswith('opts.'):
@@ -290,7 +294,9 @@
diffopts = shlex.split(path)
path = diffopts.pop(0)
else:
- path, diffopts = cmd, []
+ path, diffopts = util.findexe(cmd), []
+ if path is None:
+ path = filemerge.findexternaltool(ui, cmd) or cmd
# look for diff arguments in [diff-tools] then [merge-tools]
if diffopts == []:
args = ui.config('diff-tools', cmd+'.diffargs') or \
@@ -178,6 +178,26 @@
*/extdiff.*/a.8a5febb7f867/a a.34eed99112ab/a (glob)
[1]
+Fallback to merge-tools.tool.executable|regkey
+ $ mkdir dir
+ $ cat > 'dir/tool.sh' << EOF
+ > #!/bin/sh
+ > echo "** custom diff **"
+ > EOF
+ $ chmod +x dir/tool.sh
+ $ tool=`pwd`/dir/tool.sh
+ $ hg --debug tl --config extdiff.tl= --config merge-tools.tl.executable=$tool
+ making snapshot of 2 files from rev * (glob)
+ a
+ b
+ making snapshot of 2 files from working directory
+ a
+ b
+ running "'$TESTTMP/a/dir/tool.sh' 'a.*' 'a'" in /tmp/extdiff.* (glob)
+ ** custom diff **
+ cleaning up temp directory
+ [1]
+
$ cd ..
#endif
@@ -427,7 +427,9 @@
# add new command called vdiff, runs kdiff3
vdiff = kdiff3
- # add new command called meld, runs meld (no need to name twice)
+ # add new command called meld, runs meld (no need to name twice). If
+ # the meld executable is not available, the meld tool in [merge-tools]
+ # will be used, if available
meld =
# add new command called vimdiff, runs gvimdiff with DirDiff plugin