changeset 23128:b6f7cf47f5d1 stable

mq: do not call [0] on revset The __getitem__ method have been removed. The "first" method is to be used instead. Test have been extended to test this code path.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Sat, 01 Nov 2014 22:59:37 +0000
parents 7361d8244efb
children eb315418224c
files hgext/mq.py tests/test-mq.t
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/mq.py	Sat Nov 01 22:58:30 2014 +0000
+++ b/hgext/mq.py	Sat Nov 01 22:59:37 2014 +0000
@@ -2001,7 +2001,7 @@
                 base = repo.changelog.node(rev.first())
                 if base in [n.node for n in self.applied]:
                     raise util.Abort(_('revision %d is already managed')
-                                     % rev[0])
+                                     % rev.first())
                 if heads != [self.applied[-1].node]:
                     raise util.Abort(_('revision %d is not the parent of '
                                        'the queue') % rev.first())
--- a/tests/test-mq.t	Sat Nov 01 22:58:30 2014 +0000
+++ b/tests/test-mq.t	Sat Nov 01 22:59:37 2014 +0000
@@ -1596,4 +1596,11 @@
   $ hg ci -m a
   $ hg qimport -r 0::
 
+reimport things
+
+  $ hg qimport -r 1::
+  abort: revision 2 is already managed
+  [255]
+
+
   $ cd ..