comparison mercurial/filemerge.py @ 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 f89fd07fc51d
comparison
equal deleted inserted replaced
6075:63e0e57ab157 6076:0ee885fea464
58 tools = {} 58 tools = {}
59 for k,v in ui.configitems("merge-tools"): 59 for k,v in ui.configitems("merge-tools"):
60 t = k.split('.')[0] 60 t = k.split('.')[0]
61 if t not in tools: 61 if t not in tools:
62 tools[t] = int(_toolstr(ui, t, "priority", "0")) 62 tools[t] = int(_toolstr(ui, t, "priority", "0"))
63 names = tools.keys()
63 tools = [(-p,t) for t,p in tools.items()] 64 tools = [(-p,t) for t,p in tools.items()]
64 tools.sort() 65 tools.sort()
65 if ui.config("ui", "merge"): 66 uimerge = ui.config("ui", "merge")
66 tools.insert(0, (None, ui.config("ui", "merge"))) # highest priority 67 if uimerge:
68 if uimerge not in names:
69 return (uimerge, uimerge)
70 tools.insert(0, (None, uimerge)) # highest priority
67 tools.append((None, "hgmerge")) # the old default, if found 71 tools.append((None, "hgmerge")) # the old default, if found
68 for p,t in tools: 72 for p,t in tools:
69 toolpath = _findtool(ui, t) 73 toolpath = _findtool(ui, t)
70 if toolpath and check(t, None, symlink, binary): 74 if toolpath and check(t, None, symlink, binary):
71 return (t, '"' + toolpath + '"') 75 return (t, '"' + toolpath + '"')