hgext/histedit.py
changeset 17769 8672e615d81c
parent 17767 a787e46d3b94
child 17771 dcfa526b180b
--- a/hgext/histedit.py	Sat Oct 13 15:10:39 2012 -0500
+++ b/hgext/histedit.py	Tue Oct 16 16:04:28 2012 +0200
@@ -701,14 +701,14 @@
 
     # computed topmost element (necessary for bookmark)
     if new:
-        newtopmost = max(new, key=repo.changelog.rev)
+        newtopmost = sorted(new, key=repo.changelog.rev)[-1]
     elif not final:
         # Nothing rewritten at all. we won't need `newtopmost`
         # It is the same as `oldtopmost` and `processreplacement` know it
         newtopmost = None
     else:
         # every body died. The newtopmost is the parent of the root.
-        newtopmost = repo[min(final, key=repo.changelog.rev)].p1().node()
+        newtopmost = repo[sorted(final, key=repo.changelog.rev)[0]].p1().node()
 
     return final, tmpnodes, new, newtopmost