# HG changeset patch # User Shubhanshu Agrawal # Date 1447917610 -19800 # Node ID cf9ed6d32ccbdedf5866db8f6d81a0fc0cb11941 # Parent 8279c5d116a04999ba0ed6586f8ce1dcffdfb1ec 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 -r 8279c5d116a0 -r cf9ed6d32ccb hgext/strip.py --- a/hgext/strip.py Sun Nov 15 21:03:44 2015 +0530 +++ b/hgext/strip.py Thu Nov 19 12:50:10 2015 +0530 @@ -87,7 +87,7 @@ ('n', '', None, _('ignored (DEPRECATED)')), ('k', 'keep', None, _("do not modify working directory during " "strip")), - ('B', 'bookmark', '', _("remove revs only reachable from given" + ('B', 'bookmark', [], _("remove revs only reachable from given" " bookmark"))], _('hg strip [-k] [-f] [-n] [-B bookmark] [-r] REV...')) def stripcmd(ui, repo, *revs, **opts): @@ -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): @@ -146,8 +144,8 @@ nodetobookmarks.setdefault(node, []).append(mark) for marks in nodetobookmarks.values(): if bookmarks.issuperset(marks): - rsrevs = repair.stripbmrevset(repo, marks[0]) - revs.update(set(rsrevs)) + rsrevs = repair.stripbmrevset(repo, marks[0]) + revs.update(set(rsrevs)) if not revs: for bookmark in bookmarks: del repomarks[bookmark] diff -r 8279c5d116a0 -r cf9ed6d32ccb tests/test-strip.t --- a/tests/test-strip.t Sun Nov 15 21:03:44 2015 +0530 +++ b/tests/test-strip.t Thu Nov 19 12:50:10 2015 +0530 @@ -573,11 +573,15 @@ $ cd .. $ hg init bookmarks $ cd bookmarks - $ hg debugbuilddag '..<2.*1/2:m<2+3:c