Mercurial > public > mercurial-scm > hg
diff mercurial/copies.py @ 6762:f67d1468ac50
util: add sort helper
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 27 Jun 2008 18:28:45 -0500 |
parents | fb42030d79d6 |
children | 4dd7b28003d2 |
line wrap: on
line diff
--- a/mercurial/copies.py Fri Jun 27 14:53:30 2008 -0500 +++ b/mercurial/copies.py Fri Jun 27 18:28:45 2008 -0500 @@ -11,9 +11,7 @@ def _nonoverlap(d1, d2, d3): "Return list of elements in d1 not in d2 or d3" - l = [d for d in d1 if d not in d3 and d not in d2] - l.sort() - return l + return util.sort([d for d in d1 if d not in d3 and d not in d2]) def _dirname(f): s = f.rfind("/") @@ -49,9 +47,7 @@ visit += [(p, depth - 1) for p in fc.parents()] # return old names sorted by depth - old = old.values() - old.sort() - return [o[1] for o in old] + return [o[1] for o in util.sort(old.values())] def _findlimit(repo, a, b): "find the earliest revision that's an ancestor of a or b but not both"