changeset 6076:0ee885fea464

filemerge: more backwards compatible behavior for ui.merge if ui.merge matches a tool in [merge-tools], it is used as the default tool selection but may be rejected by binary or gui or other checks. If ui.merge does not match a merge tool, it is used unconditionally.
author Steve Borho <steve@borho.org>
date Wed, 06 Feb 2008 20:44:25 -0600
parents 63e0e57ab157
children fb259a3572e9
files mercurial/filemerge.py
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/filemerge.py	Wed Feb 06 20:32:06 2008 -0600
+++ b/mercurial/filemerge.py	Wed Feb 06 20:44:25 2008 -0600
@@ -60,10 +60,14 @@
         t = k.split('.')[0]
         if t not in tools:
             tools[t] = int(_toolstr(ui, t, "priority", "0"))
+    names = tools.keys()
     tools = [(-p,t) for t,p in tools.items()]
     tools.sort()
-    if ui.config("ui", "merge"):
-        tools.insert(0, (None, ui.config("ui", "merge"))) # highest priority
+    uimerge = ui.config("ui", "merge")
+    if uimerge:
+        if uimerge not in names:
+            return (uimerge, uimerge)
+        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)