--- a/hgext/mq.py Sat Jul 31 11:41:58 2010 +0900
+++ b/hgext/mq.py Sat Jul 31 18:12:50 2010 -0500
@@ -1051,12 +1051,16 @@
self.check_localchanges(repo)
if move:
- try:
- 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)
+ if not patch:
+ raise util.Abort(_("please specify the patch to move"))
+ for i, rpn in enumerate(self.full_series[start:]):
+ # strip markers for patch guards
+ if self.guard_re.split(rpn, 1)[0] == patch:
+ break
+ index = start + i
+ assert index < len(self.full_series)
+ fullpatch = self.full_series[index]
+ del self.full_series[index]
self.full_series.insert(start, fullpatch)
self.parse_series()
self.series_dirty = 1