changeset 9973:d1319ad5071b

context: use key-sorting instead of tuples
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Tue, 01 Dec 2009 01:03:54 +0100
parents f603299ffa7a
children da5209afe1bc
files mercurial/context.py
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Tue Dec 01 00:43:54 2009 +0100
+++ b/mercurial/context.py	Tue Dec 01 01:03:54 2009 +0100
@@ -433,11 +433,10 @@
         # sort by revision (per file) which is a topological order
         visit = []
         for f in files:
-            fn = [(n.rev(), n) for n in needed if n._path == f]
-            visit.extend(fn)
+            visit.extend(n for n in needed if n._path == f)
 
         hist = {}
-        for r, f in sorted(visit):
+        for f in sorted(visit, key=lambda x: x.rev()):
             curr = decorate(f.data(), f)
             for p in parents(f):
                 if p != nullid: