[PATCH 6 of 7] strip: introduce a soft strip option
Pulkit Goyal
7895pulkit at gmail.com
Thu Jan 3 10:23:41 EST 2019
On Thu, Jan 3, 2019 at 4:14 AM Boris Feld <boris.feld at octobus.net> wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld at octobus.net>
> # Date 1539697680 -7200
> # Tue Oct 16 15:48:00 2018 +0200
> # Node ID a82909c0da7cc07ea1a46690ffc08e45ebc14af6
> # Parent 65488c7d2e933cdb2ab1c36b3887a8a67a24fc60
> # EXP-Topic archived-phase-UX
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> # hg pull https://bitbucket.org/octobus/mercurial-devel/ -r
> a82909c0da7c
> strip: introduce a soft strip option
>
> This is the first user-accessible way to use the archived phase introduced
> in
> 4.8. This implements a feature implemented during the Stockholm sprint. The
> archived phase behave as stripping, changesets are no longer accessible,
> but
> pulling/unbundling them will make then reappear. The only notable
> difference
> is that unlike hard stripping, soft stripping does not affect obsmarkers.
>
> Adding flag to strip is a good way to provide access to the feature without
> taking a too big risk on the final UI we want.
>
> The next changeset will make use of the archived phase for history
> rewriting
> command. However, having a way to manually trigger the feature first seemed
> better.
>
> Using the archived phase is faster and less traumatic for the repository.
>
> diff --git a/hgext/strip.py b/hgext/strip.py
> --- a/hgext/strip.py
> +++ b/hgext/strip.py
> @@ -76,7 +76,8 @@ def _findupdatetarget(repo, nodes):
>
> return unode
>
> -def strip(ui, repo, revs, update=True, backup=True, force=None,
> bookmarks=None):
> +def strip(ui, repo, revs, update=True, backup=True, force=None,
> bookmarks=None,
> + soft=False):
> with repo.wlock(), repo.lock():
>
> if update:
> @@ -85,7 +86,10 @@ def strip(ui, repo, revs, update=True, b
> hg.clean(repo, urev)
> repo.dirstate.write(repo.currenttransaction())
>
> - repair.strip(ui, repo, revs, backup)
> + if soft:
> + repair.softstrip(ui, repo, revs, backup)
> + else:
> + repair.strip(ui, repo, revs, backup)
>
> repomarks = repo._bookmarks
> if bookmarks:
> @@ -110,7 +114,10 @@ def strip(ui, repo, revs, update=True, b
> ('k', 'keep', None, _("do not modify working directory during "
> "strip")),
> ('B', 'bookmark', [], _("remove revs only reachable from given"
> - " bookmark"), _('BOOKMARK'))],
> + " bookmark"), _('BOOKMARK')),
> + ('', 'soft', [],
>
Do we plan to accept arguments with `--soft`? If not, the default value
should be None.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20190103/8cce2520/attachment.html>
More information about the Mercurial-devel
mailing list