Mercurial > public > mercurial-scm > hg
diff hgext/convert/hg.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 | cce63ef1045b |
children | 1b60efdb8bc5 |
line wrap: on
line diff
--- a/hgext/convert/hg.py Sun Apr 26 16:50:44 2009 -0500 +++ b/hgext/convert/hg.py Sun Apr 26 16:50:44 2009 -0500 @@ -163,11 +163,11 @@ tagparent = nullid try: - oldlines = util.sort(parentctx['.hgtags'].data().splitlines(1)) + oldlines = sorted(parentctx['.hgtags'].data().splitlines(1)) except: oldlines = [] - newlines = util.sort([("%s %s\n" % (tags[tag], tag)) for tag in tags]) + newlines = sorted([("%s %s\n" % (tags[tag], tag)) for tag in tags]) if newlines == oldlines: return None data = "".join(newlines) @@ -251,7 +251,7 @@ ctx = self.changectx(rev) parents = self.parents(ctx) if not parents: - files = util.sort(ctx.manifest().keys()) + files = sorted(ctx.manifest()) if self.ignoreerrors: # calling getcopies() is a simple way to detect missing # revlogs and populate self.ignored @@ -266,7 +266,7 @@ copies = self.getcopies(ctx, m + a) changes = [(name, rev) for name in m + a + r if name not in self.ignored] - return util.sort(changes), copies + return sorted(changes), copies def getcopies(self, ctx, files): copies = {}