mq: use `last` instead of direct indexing
authorPierre-Yves David <pierre-yves.david@fb.com>
Tue, 07 Oct 2014 00:14:53 -0700
changeset 22819 602aa2b98628
parent 22818 d7b114493315
child 22820 103dcfbb385f
mq: use `last` instead of direct indexing This makes it compatible with all smartset classes.
hgext/mq.py
--- 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]: