comparison tests/test-mq.t @ 16303:7ee8aa662937 stable

mq: fix qpush --move with comments in series file between applied patches The 'start' variable pointed to qtip in self.series, but it was used for indexing self.fullseries. When fullseries had holes and the patch was moved to self.fullseries[start] it would end up too early in self.series and it could thus not be found in self.series[start:] and it would crash. Now the 'fullstart' index in fullseries is found used instead.
author Mads Kiilerich <mads@kiilerich.com>
date Thu, 29 Mar 2012 00:35:00 +0200
parents 9518cb55c822
children 73f4e05287b4 7c76587fb372
comparison
equal deleted inserted replaced
16302:49b54f1ae053 16303:7ee8aa662937
517 abort: please specify the patch to move 517 abort: please specify the patch to move
518 [255] 518 [255]
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 applying test2.patch
524 now at: test2.patch
525
526
527 series after move
528
529 $ cat `hg root`/.hg/patches/series 523 $ cat `hg root`/.hg/patches/series
524 # comment
525 # make qtip index different in series and fullseries
526
530 test.patch 527 test.patch
531 test1b.patch 528 test1b.patch
532 test2.patch 529 test2.patch
530 $ hg qpush --move test2.patch
531 applying test2.patch
532 now at: test2.patch
533
534
535 series after move
536
537 $ cat `hg root`/.hg/patches/series
533 # comment 538 # comment
534 539 # make qtip index different in series and fullseries
540
541 test.patch
542 test1b.patch
543 test2.patch
535 544
536 545
537 pop, qapplied, qunapplied 546 pop, qapplied, qunapplied
538 547
539 $ hg qseries -v 548 $ hg qseries -v