From patchwork Mon Nov 16 20:52:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [3,of,3,v4] strip: changing bookmark argument to be a list From: Shubhanshu Agrawal X-Patchwork-Id: 11413 Message-Id: <7b25c4165a42e38d2bb7.1447707155@waste.org> To: mercurial-devel@selenic.com Date: Mon, 16 Nov 2015 14:52:35 -0600 # HG changeset patch # User Shubhanshu Agrawal # Date 1447603596 -19800 # Sun Nov 15 21:36:36 2015 +0530 # Node ID 7b25c4165a42e38d2bb7f1549c9e899de49beaaf # Parent bf69fb14d9bc27092c45899218589e372b396011 strip: changing bookmark argument to be a list Currently strip works with a single bookmark, the changes in this patch modifies the strip extension to accept a list of bookmarks diff --git a/hgext/strip.py b/hgext/strip.py --- a/hgext/strip.py +++ b/hgext/strip.py @@ -87,8 +87,8 @@ ('n', '', None, _('ignored (DEPRECATED)')), ('k', 'keep', None, _("do not modify working directory during " "strip")), - ('B', 'bookmark', '', _("remove revs only reachable from given" - " bookmark"))], + ('B', 'bookmark', [], _("remove revs only reachable from given" + " bookmark"), 'list')], _('hg strip [-k] [-f] [-n] [-B bookmark] [-r] REV...')) def stripcmd(ui, repo, *revs, **opts): """strip changesets and all their descendants from the repository @@ -129,9 +129,7 @@ wlock = repo.wlock() try: - bookmarks = None - if opts.get('bookmark'): - bookmarks = set([opts.get('bookmark')]) + bookmarks = set(opts.get('bookmark')) if bookmarks: repomarks = repo._bookmarks if not bookmarks.issubset(repomarks): diff --git a/tests/test-strip.t b/tests/test-strip.t --- a/tests/test-strip.t +++ b/tests/test-strip.t @@ -573,11 +573,15 @@ $ cd .. $ hg init bookmarks $ cd bookmarks - $ hg debugbuilddag '..<2.*1/2:m<2+3:c