##// END OF EJS Templates
mq: fix qpush --move with comments in series file between applied patches...
Mads Kiilerich -
r16303:7ee8aa66 stable
parent child Browse files
Show More
@@ -1200,15 +1200,19 b' class queue(object):'
1200 if move:
1200 if move:
1201 if not patch:
1201 if not patch:
1202 raise util.Abort(_("please specify the patch to move"))
1202 raise util.Abort(_("please specify the patch to move"))
1203 for i, rpn in enumerate(self.fullseries[start:]):
1203 for fullstart, rpn in enumerate(self.fullseries):
1204 # strip markers for patch guards
1205 if self.guard_re.split(rpn, 1)[0] == self.series[start]:
1206 break
1207 for i, rpn in enumerate(self.fullseries[fullstart:]):
1204 # strip markers for patch guards
1208 # strip markers for patch guards
1205 if self.guard_re.split(rpn, 1)[0] == patch:
1209 if self.guard_re.split(rpn, 1)[0] == patch:
1206 break
1210 break
1207 index = start + i
1211 index = fullstart + i
1208 assert index < len(self.fullseries)
1212 assert index < len(self.fullseries)
1209 fullpatch = self.fullseries[index]
1213 fullpatch = self.fullseries[index]
1210 del self.fullseries[index]
1214 del self.fullseries[index]
1211 self.fullseries.insert(start, fullpatch)
1215 self.fullseries.insert(fullstart, fullpatch)
1212 self.parseseries()
1216 self.parseseries()
1213 self.seriesdirty = True
1217 self.seriesdirty = True
1214
1218
@@ -519,7 +519,15 b' cleaning up'
519 $ hg qpush --move test.patch # already applied
519 $ hg qpush --move test.patch # already applied
520 abort: cannot push to a previous patch: test.patch
520 abort: cannot push to a previous patch: test.patch
521 [255]
521 [255]
522 $ hg qpush
522 $ sed -i.bak '2i# make qtip index different in series and fullseries' `hg root`/.hg/patches/series
523 $ cat `hg root`/.hg/patches/series
524 # comment
525 # make qtip index different in series and fullseries
526
527 test.patch
528 test1b.patch
529 test2.patch
530 $ hg qpush --move test2.patch
523 applying test2.patch
531 applying test2.patch
524 now at: test2.patch
532 now at: test2.patch
525
533
@@ -527,11 +535,12 b' cleaning up'
527 series after move
535 series after move
528
536
529 $ cat `hg root`/.hg/patches/series
537 $ cat `hg root`/.hg/patches/series
538 # comment
539 # make qtip index different in series and fullseries
540
530 test.patch
541 test.patch
531 test1b.patch
542 test1b.patch
532 test2.patch
543 test2.patch
533 # comment
534
535
544
536
545
537 pop, qapplied, qunapplied
546 pop, qapplied, qunapplied
General Comments 0
You need to be logged in to leave comments. Login now