Mercurial > public > mercurial-scm > hg
comparison mercurial/filemerge.py @ 8209:a1a5a57efe90
replace util.sort with sorted built-in
This is marginally faster for small and moderately-sized lists
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sun, 26 Apr 2009 16:50:44 -0500 |
parents | 4a4c7f6a5912 |
children | 46293a0c7e9f |
comparison
equal
deleted
inserted
replaced
8208:32a2a1e244f1 | 8209:a1a5a57efe90 |
---|---|
64 for k,v in ui.configitems("merge-tools"): | 64 for k,v in ui.configitems("merge-tools"): |
65 t = k.split('.')[0] | 65 t = k.split('.')[0] |
66 if t not in tools: | 66 if t not in tools: |
67 tools[t] = int(_toolstr(ui, t, "priority", "0")) | 67 tools[t] = int(_toolstr(ui, t, "priority", "0")) |
68 names = tools.keys() | 68 names = tools.keys() |
69 tools = util.sort([(-p,t) for t,p in tools.items()]) | 69 tools = sorted([(-p,t) for t,p in tools.items()]) |
70 uimerge = ui.config("ui", "merge") | 70 uimerge = ui.config("ui", "merge") |
71 if uimerge: | 71 if uimerge: |
72 if uimerge not in names: | 72 if uimerge not in names: |
73 return (uimerge, uimerge) | 73 return (uimerge, uimerge) |
74 tools.insert(0, (None, uimerge)) # highest priority | 74 tools.insert(0, (None, uimerge)) # highest priority |