Show More
@@ -87,7 +87,7 b' def strip(ui, repo, revs, update=True, b' | |||||
87 | ('n', '', None, _('ignored (DEPRECATED)')), |
|
87 | ('n', '', None, _('ignored (DEPRECATED)')), | |
88 | ('k', 'keep', None, _("do not modify working directory during " |
|
88 | ('k', 'keep', None, _("do not modify working directory during " | |
89 | "strip")), |
|
89 | "strip")), | |
90 |
('B', 'bookmark', |
|
90 | ('B', 'bookmark', [], _("remove revs only reachable from given" | |
91 | " bookmark"))], |
|
91 | " bookmark"))], | |
92 | _('hg strip [-k] [-f] [-n] [-B bookmark] [-r] REV...')) |
|
92 | _('hg strip [-k] [-f] [-n] [-B bookmark] [-r] REV...')) | |
93 | def stripcmd(ui, repo, *revs, **opts): |
|
93 | def stripcmd(ui, repo, *revs, **opts): | |
@@ -129,9 +129,7 b' def stripcmd(ui, repo, *revs, **opts):' | |||||
129 |
|
129 | |||
130 | wlock = repo.wlock() |
|
130 | wlock = repo.wlock() | |
131 | try: |
|
131 | try: | |
132 |
bookmarks = |
|
132 | bookmarks = set(opts.get('bookmark')) | |
133 | if opts.get('bookmark'): |
|
|||
134 | bookmarks = set([opts.get('bookmark')]) |
|
|||
135 | if bookmarks: |
|
133 | if bookmarks: | |
136 | repomarks = repo._bookmarks |
|
134 | repomarks = repo._bookmarks | |
137 | if not bookmarks.issubset(repomarks): |
|
135 | if not bookmarks.issubset(repomarks): |
@@ -573,11 +573,15 b' test hg strip -B bookmark' | |||||
573 | $ cd .. |
|
573 | $ cd .. | |
574 | $ hg init bookmarks |
|
574 | $ hg init bookmarks | |
575 | $ cd bookmarks |
|
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 | $ hg bookmark -r 'a' 'todelete' |
|
577 | $ hg bookmark -r 'a' 'todelete' | |
578 | $ hg bookmark -r 'b' 'B' |
|
578 | $ hg bookmark -r 'b' 'B' | |
579 | $ hg bookmark -r 'b' 'nostrip' |
|
579 | $ hg bookmark -r 'b' 'nostrip' | |
580 | $ hg bookmark -r 'c' 'delete' |
|
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 | $ hg up -C todelete |
|
585 | $ hg up -C todelete | |
582 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
586 | 0 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
583 | (activating bookmark todelete) |
|
587 | (activating bookmark todelete) | |
@@ -597,6 +601,36 b' test hg strip -B bookmark' | |||||
597 | $ hg bookmarks |
|
601 | $ hg bookmarks | |
598 | B 9:ff43616e5d0f |
|
602 | B 9:ff43616e5d0f | |
599 | delete 6:2702dd0c91e7 |
|
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 | $ hg strip -B delete |
|
634 | $ hg strip -B delete | |
601 | saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob) |
|
635 | saved backup bundle to $TESTTMP/bookmarks/.hg/strip-backup/*-backup.hg (glob) | |
602 | bookmark 'delete' deleted |
|
636 | bookmark 'delete' deleted | |
@@ -626,13 +660,13 b' Make sure no one adds back a -b option:' | |||||
626 |
|
660 | |||
627 | options ([+] can be repeated): |
|
661 | options ([+] can be repeated): | |
628 |
|
662 | |||
629 |
-r --rev REV [+] strip specified revision (optional, can specify |
|
663 | -r --rev REV [+] strip specified revision (optional, can specify | |
630 | without this option) |
|
664 | revisions without this option) | |
631 |
-f --force force removal of changesets, discard uncommitted |
|
665 | -f --force force removal of changesets, discard uncommitted | |
632 | (no backup) |
|
666 | changes (no backup) | |
633 | --no-backup no backups |
|
667 | --no-backup no backups | |
634 | -k --keep do not modify working directory during strip |
|
668 | -k --keep do not modify working directory during strip | |
635 | -B --bookmark VALUE remove revs only reachable from given bookmark |
|
669 | -B --bookmark VALUE [+] remove revs only reachable from given bookmark | |
636 | --mq operate on patch repository |
|
670 | --mq operate on patch repository | |
637 |
|
671 | |||
638 | (use "hg strip -h" to show more help) |
|
672 | (use "hg strip -h" to show more help) |
General Comments 0
You need to be logged in to leave comments.
Login now