comparison mercurial/filemerge.py @ 10282:08a0f04b56bd

many, many trivial check-code fixups
author Matt Mackall <mpm@selenic.com>
date Mon, 25 Jan 2010 00:05:27 -0600
parents 25e572394f5c
children 23e608f42f2c
comparison
equal deleted inserted replaced
10281:e7d3b509af8b 10282:08a0f04b56bd
63 toolpath = _findtool(ui, tool) 63 toolpath = _findtool(ui, tool)
64 return (tool, '"' + toolpath + '"') 64 return (tool, '"' + toolpath + '"')
65 65
66 # then merge tools 66 # then merge tools
67 tools = {} 67 tools = {}
68 for k,v in ui.configitems("merge-tools"): 68 for k, v in ui.configitems("merge-tools"):
69 t = k.split('.')[0] 69 t = k.split('.')[0]
70 if t not in tools: 70 if t not in tools:
71 tools[t] = int(_toolstr(ui, t, "priority", "0")) 71 tools[t] = int(_toolstr(ui, t, "priority", "0"))
72 names = tools.keys() 72 names = tools.keys()
73 tools = sorted([(-p,t) for t,p in tools.items()]) 73 tools = sorted([(-p, t) for t, p in tools.items()])
74 uimerge = ui.config("ui", "merge") 74 uimerge = ui.config("ui", "merge")
75 if uimerge: 75 if uimerge:
76 if uimerge not in names: 76 if uimerge not in names:
77 return (uimerge, uimerge) 77 return (uimerge, uimerge)
78 tools.insert(0, (None, uimerge)) # highest priority 78 tools.insert(0, (None, uimerge)) # highest priority
79 tools.append((None, "hgmerge")) # the old default, if found 79 tools.append((None, "hgmerge")) # the old default, if found
80 for p,t in tools: 80 for p, t in tools:
81 if check(t, None, symlink, binary): 81 if check(t, None, symlink, binary):
82 toolpath = _findtool(ui, t) 82 toolpath = _findtool(ui, t)
83 return (t, '"' + toolpath + '"') 83 return (t, '"' + toolpath + '"')
84 # internal merge as last resort 84 # internal merge as last resort
85 return (not (symlink or binary) and "internal:merge" or None, None) 85 return (not (symlink or binary) and "internal:merge" or None, None)