Mercurial > public > mercurial-scm > hg-stable
diff mercurial/patch.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 | 388bb482024e |
children | 46293a0c7e9f |
line wrap: on
line diff
--- a/mercurial/patch.py Sun Apr 26 16:50:44 2009 -0500 +++ b/mercurial/patch.py Sun Apr 26 16:50:44 2009 -0500 @@ -1053,7 +1053,7 @@ repo.copy(src, dst) removes = removes.keys() if (not similarity) and removes: - repo.remove(util.sort(removes), True) + repo.remove(sorted(removes), True) for f in patches: gp = patches[f] if gp and gp.mode: @@ -1068,7 +1068,7 @@ cmdutil.addremove(repo, cfiles, similarity=similarity) files = patches.keys() files.extend([r for r in removes if r not in files]) - return util.sort(files) + return sorted(files) def externalpatch(patcher, args, patchname, ui, strip, cwd, files): """use <patcher> to apply <patchname> to the working directory. @@ -1242,7 +1242,7 @@ gone = {} gitmode = {'l': '120000', 'x': '100755', '': '100644'} - for f in util.sort(modified + added + removed): + for f in sorted(modified + added + removed): to = None tn = None dodiff = True