# HG changeset patch # User Mads Kiilerich # Date 2008-11-07 01:47:12 # Node ID 4c92d897180908ad547006f94c265c72d28c9fb1 # Parent 526c40a74bd0a97330458a1754d88371ce176060 More verbose logging when filemerge searches for merge-tool Previously it was very hard to find out what was going on when the expected merge tool wasn't used. This patch tries to improve that. hg merge -v now shows which tools were searched for but not found. diff --git a/mercurial/filemerge.py b/mercurial/filemerge.py --- a/mercurial/filemerge.py +++ b/mercurial/filemerge.py @@ -32,8 +32,11 @@ def _picktool(repo, ui, path, binary, sy tmsg = tool if pat: tmsg += " specified for " + pat - if pat and not _findtool(ui, tool): # skip search if not matching - ui.warn(_("couldn't find merge tool %s\n") % tmsg) + if not _findtool(ui, tool): + if pat: # explicitly requested tool deserves a warning + ui.warn(_("couldn't find merge tool %s\n") % tmsg) + else: # configured but non-existing tools are more silent + ui.note(_("couldn't find merge tool %s\n") % tmsg) elif symlink and not _toolbool(ui, tool, "symlink"): ui.warn(_("tool %s can't handle symlinks\n") % tmsg) elif binary and not _toolbool(ui, tool, "binary"): @@ -71,8 +74,8 @@ def _picktool(repo, ui, path, binary, sy tools.insert(0, (None, uimerge)) # highest priority tools.append((None, "hgmerge")) # the old default, if found for p,t in tools: - toolpath = _findtool(ui, t) - if toolpath and check(t, None, symlink, binary): + if check(t, None, symlink, binary): + toolpath = _findtool(ui, t) return (t, '"' + toolpath + '"') # internal merge as last resort return (not (symlink or binary) and "internal:merge" or None, None)