comparison mercurial/filemerge.py @ 7397:4c92d8971809

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.
author Mads Kiilerich <mads@kiilerich.com>
date Fri, 07 Nov 2008 02:47:12 +0100
parents f67d1468ac50
children 4a4c7f6a5912
comparison
equal deleted inserted replaced
7396:526c40a74bd0 7397:4c92d8971809
30 def _picktool(repo, ui, path, binary, symlink): 30 def _picktool(repo, ui, path, binary, symlink):
31 def check(tool, pat, symlink, binary): 31 def check(tool, pat, symlink, binary):
32 tmsg = tool 32 tmsg = tool
33 if pat: 33 if pat:
34 tmsg += " specified for " + pat 34 tmsg += " specified for " + pat
35 if pat and not _findtool(ui, tool): # skip search if not matching 35 if not _findtool(ui, tool):
36 ui.warn(_("couldn't find merge tool %s\n") % tmsg) 36 if pat: # explicitly requested tool deserves a warning
37 ui.warn(_("couldn't find merge tool %s\n") % tmsg)
38 else: # configured but non-existing tools are more silent
39 ui.note(_("couldn't find merge tool %s\n") % tmsg)
37 elif symlink and not _toolbool(ui, tool, "symlink"): 40 elif symlink and not _toolbool(ui, tool, "symlink"):
38 ui.warn(_("tool %s can't handle symlinks\n") % tmsg) 41 ui.warn(_("tool %s can't handle symlinks\n") % tmsg)
39 elif binary and not _toolbool(ui, tool, "binary"): 42 elif binary and not _toolbool(ui, tool, "binary"):
40 ui.warn(_("tool %s can't handle binary\n") % tmsg) 43 ui.warn(_("tool %s can't handle binary\n") % tmsg)
41 elif not util.gui() and _toolbool(ui, tool, "gui"): 44 elif not util.gui() and _toolbool(ui, tool, "gui"):
69 if uimerge not in names: 72 if uimerge not in names:
70 return (uimerge, uimerge) 73 return (uimerge, uimerge)
71 tools.insert(0, (None, uimerge)) # highest priority 74 tools.insert(0, (None, uimerge)) # highest priority
72 tools.append((None, "hgmerge")) # the old default, if found 75 tools.append((None, "hgmerge")) # the old default, if found
73 for p,t in tools: 76 for p,t in tools:
74 toolpath = _findtool(ui, t) 77 if check(t, None, symlink, binary):
75 if toolpath and check(t, None, symlink, binary): 78 toolpath = _findtool(ui, t)
76 return (t, '"' + toolpath + '"') 79 return (t, '"' + toolpath + '"')
77 # internal merge as last resort 80 # internal merge as last resort
78 return (not (symlink or binary) and "internal:merge" or None, None) 81 return (not (symlink or binary) and "internal:merge" or None, None)
79 82
80 def _eoltype(data): 83 def _eoltype(data):