Fix issue 589: "undelete" sequence leads to crash.
authorPatrick Mezard <pmezard@gmail.com>
Wed, 20 Jun 2007 00:10:21 +0200
changeset 4638 3c7fc13c4bfa
parent 4637 5a088ac232e6
child 4639 c7371aa0c153
Fix issue 589: "undelete" sequence leads to crash.
mercurial/context.py
--- a/mercurial/context.py	Wed Jun 20 00:09:32 2007 +0200
+++ b/mercurial/context.py	Wed Jun 20 00:10:21 2007 +0200
@@ -292,11 +292,10 @@
 
         # sort by revision (per file) which is a topological order
         visit = []
-        files.reverse()
         for f in files:
-            fn = [(n._filerev, n) for n in needed.keys() if n._path == f]
-            fn.sort()
+            fn = [(n.rev(), n) for n in needed.keys() if n._path == f]
             visit.extend(fn)
+        visit.sort()
         hist = {}
 
         for r, f in visit: