# HG changeset patch # User Pierre-Yves David # Date 2014-10-07 07:16:59 # Node ID 103dcfbb385f3ec29e6e98bbe8aca3fe5216de64 # Parent 602aa2b9862897aa28b8151bc7983f5929b3d699 rebase: use `last` instead of direct indexing This makes it compatible with all smartset classes. diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -596,7 +596,7 @@ def nearestrebased(repo, rev, state): 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