##// END OF EJS Templates
strip: changing bookmark argument to be a list...
Shubhanshu Agrawal -
r27030:cf9ed6d3 default
parent child Browse files
Show More
@@ -87,7 +87,7 b' def strip(ui, repo, revs, update=True, b'
87 87 ('n', '', None, _('ignored (DEPRECATED)')),
88 88 ('k', 'keep', None, _("do not modify working directory during "
89 89 "strip")),
90 ('B', 'bookmark', '', _("remove revs only reachable from given"
90 ('B', 'bookmark', [], _("remove revs only reachable from given"
91 91 " bookmark"))],
92 92 _('hg strip [-k] [-f] [-n] [-B bookmark] [-r] REV...'))
93 93 def stripcmd(ui, repo, *revs, **opts):
@@ -129,9 +129,7 b' def stripcmd(ui, repo, *revs, **opts):'
129 129
130 130 wlock = repo.wlock()
131 131 try:
132 bookmarks = None
133 if opts.get('bookmark'):
134 bookmarks = set([opts.get('bookmark')])
132 bookmarks = set(opts.get('bookmark'))
135 133 if bookmarks:
136 134 repomarks = repo._bookmarks
137 135 if not bookmarks.issubset(repomarks):
@@ -146,8 +144,8 b' def stripcmd(ui, repo, *revs, **opts):'
146 144 nodetobookmarks.setdefault(node, []).append(mark)
147 145 for marks in nodetobookmarks.values():
148 146 if bookmarks.issuperset(marks):
149 rsrevs = repair.stripbmrevset(repo, marks[0])
150 revs.update(set(rsrevs))
147 rsrevs = repair.stripbmrevset(repo, marks[0])
148 revs.update(set(rsrevs))
151 149 if not revs:
152 150 for bookmark in bookmarks:
153 151 del repomarks[bookmark]
@@ -573,11 +573,15 b' test hg strip -B bookmark'
573 573 $ cd ..
574 574 $ hg init bookmarks
575 575 $ cd bookmarks
576 $ hg debugbuilddag '..<2.*1/2:m<2+3:c<m+3:a<2.:b'
576 $ hg debugbuilddag '..<2.*1/2:m<2+3:c<m+3:a<2.:b<m+2:d<2.:e<m+1:f'
577 577 $ hg bookmark -r 'a' 'todelete'
578 578 $ hg bookmark -r 'b' 'B'
579 579 $ hg bookmark -r 'b' 'nostrip'
580 580 $ hg bookmark -r 'c' 'delete'
581 $ hg bookmark -r 'd' 'multipledelete1'
582 $ hg bookmark -r 'e' 'multipledelete2'
583 $ hg bookmark -r 'f' 'singlenode1'
584 $ hg bookmark -r 'f' 'singlenode2'
581 585 $ hg up -C todelete
582 586 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
583 587 (activating bookmark todelete)
@@ -597,6 +601,36 b' test hg strip -B bookmark'
597 601 $ hg bookmarks
598 602 B 9:ff43616e5d0f
599 603 delete 6:2702dd0c91e7
604 multipledelete1 11:e46a4836065c
605 multipledelete2 12:b4594d867745
606 singlenode1 13:43227190fef8
607 singlenode2 13:43227190fef8
608 $ hg strip -B multipledelete1 -B multipledelete2
609 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/e46a4836065c-89ec65c2-backup.hg (glob)
610 bookmark 'multipledelete1' deleted
611 bookmark 'multipledelete2' deleted
612 $ hg id -ir e46a4836065c
613 abort: unknown revision 'e46a4836065c'!
614 [255]
615 $ hg id -ir b4594d867745
616 abort: unknown revision 'b4594d867745'!
617 [255]
618 $ hg strip -B singlenode1 -B singlenode2
619 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/43227190fef8-8da858f2-backup.hg (glob)
620 bookmark 'singlenode1' deleted
621 bookmark 'singlenode2' deleted
622 $ hg id -ir 43227190fef8
623 abort: unknown revision '43227190fef8'!
624 [255]
625 $ hg strip -B unknownbookmark
626 abort: bookmark 'unknownbookmark' not found
627 [255]
628 $ hg strip -B unknownbookmark1 -B unknownbookmark2
629 abort: bookmark 'unknownbookmark1,unknownbookmark2' not found
630 [255]
631 $ hg strip -B delete -B unknownbookmark
632 abort: bookmark 'unknownbookmark' not found
633 [255]
600 634 $ hg strip -B delete
601 635 saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob)
602 636 bookmark 'delete' deleted
@@ -626,14 +660,14 b' Make sure no one adds back a -b option:'
626 660
627 661 options ([+] can be repeated):
628 662
629 -r --rev REV [+] strip specified revision (optional, can specify revisions
630 without this option)
631 -f --force force removal of changesets, discard uncommitted changes
632 (no backup)
633 --no-backup no backups
634 -k --keep do not modify working directory during strip
635 -B --bookmark VALUE remove revs only reachable from given bookmark
636 --mq operate on patch repository
663 -r --rev REV [+] strip specified revision (optional, can specify
664 revisions without this option)
665 -f --force force removal of changesets, discard uncommitted
666 changes (no backup)
667 --no-backup no backups
668 -k --keep do not modify working directory during strip
669 -B --bookmark VALUE [+] remove revs only reachable from given bookmark
670 --mq operate on patch repository
637 671
638 672 (use "hg strip -h" to show more help)
639 673 [255]
General Comments 0
You need to be logged in to leave comments. Login now