comparison mercurial/filemerge.py @ 6762:f67d1468ac50

util: add sort helper
author Matt Mackall <mpm@selenic.com>
date Fri, 27 Jun 2008 18:28:45 -0500
parents d3691d31fc9c
children 4c92d8971809
comparison
equal deleted inserted replaced
6761:cb981fc955fb 6762:f67d1468ac50
61 for k,v in ui.configitems("merge-tools"): 61 for k,v in ui.configitems("merge-tools"):
62 t = k.split('.')[0] 62 t = k.split('.')[0]
63 if t not in tools: 63 if t not in tools:
64 tools[t] = int(_toolstr(ui, t, "priority", "0")) 64 tools[t] = int(_toolstr(ui, t, "priority", "0"))
65 names = tools.keys() 65 names = tools.keys()
66 tools = [(-p,t) for t,p in tools.items()] 66 tools = util.sort([(-p,t) for t,p in tools.items()])
67 tools.sort()
68 uimerge = ui.config("ui", "merge") 67 uimerge = ui.config("ui", "merge")
69 if uimerge: 68 if uimerge:
70 if uimerge not in names: 69 if uimerge not in names:
71 return (uimerge, uimerge) 70 return (uimerge, uimerge)
72 tools.insert(0, (None, uimerge)) # highest priority 71 tools.insert(0, (None, uimerge)) # highest priority