rebase: use `last` instead of direct indexing
authorPierre-Yves David <pierre-yves.david@fb.com>
Tue, 07 Oct 2014 00:16:59 -0700
changeset 22820 103dcfbb385f
parent 22819 602aa2b98628
child 22821 5d4c17d11d7e
rebase: use `last` instead of direct indexing This makes it compatible with all smartset classes.
hgext/rebase.py
--- a/hgext/rebase.py	Tue Oct 07 00:14:53 2014 -0700
+++ b/hgext/rebase.py	Tue Oct 07 00:16:59 2014 -0700
@@ -596,7 +596,7 @@
     rebased = [r for r in state if state[r] > nullmerge]
     candidates = repo.revs('max(%ld  and (::%d))', rebased, rev)
     if candidates:
-        return state[candidates[0]]
+        return state[candidates.first()]
     else:
         return None