diff hgext/mq.py @ 22819:602aa2b98628

mq: use `last` instead of direct indexing This makes it compatible with all smartset classes.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Tue, 07 Oct 2014 00:14:53 -0700
parents 31a591c3fecc
children 5d4c17d11d7e
line wrap: on
line diff
--- a/hgext/mq.py	Tue Oct 07 00:09:50 2014 -0700
+++ b/hgext/mq.py	Tue Oct 07 00:14:53 2014 -0700
@@ -1995,7 +1995,7 @@
             heads = repo.changelog.heads(repo.changelog.node(rev[-1]))
             if len(heads) > 1:
                 raise util.Abort(_('revision %d is the root of more than one '
-                                   'branch') % rev[-1])
+                                   'branch') % rev.last())
             if self.applied:
                 base = repo.changelog.node(rev[0])
                 if base in [n.node for n in self.applied]: