mq: fix qpush --move for selected guarded patches stable
authorGilles Moris <gilles.moris@free.fr>
Tue, 22 Jun 2010 09:49:51 +0200
branchstable
changeset 11438 88fc876a4833
parent 11437 9fa255c32406
child 11439 778377be3662
mq: fix qpush --move for selected guarded patches In the case of guarded patch, the patch could not be found because the full_series list contains also the guard value appended to each patch name. As we already checked that the patch is pushable above in the code, we just have to use the series list (which doesn't contains guard value) to get the patch index.
hgext/mq.py
--- a/hgext/mq.py	Wed Jun 23 17:50:27 2010 -0300
+++ b/hgext/mq.py	Tue Jun 22 09:49:51 2010 +0200
@@ -1046,10 +1046,12 @@
 
             if move:
                 try:
-                    del self.full_series[self.full_series.index(patch, start)]
+                    index = self.series.index(patch, start)
+                    fullpatch = self.full_series[index]
+                    del self.full_series[index]
                 except ValueError:
                     raise util.Abort(_("patch '%s' not found") % patch)
-                self.full_series.insert(start, patch)
+                self.full_series.insert(start, fullpatch)
                 self.parse_series()
                 self.series_dirty = 1