[PATCH] revert: add an experimental config to use inverted selection
Pierre-Yves David
pierre-yves.david at ens-lyon.org
Fri May 29 21:09:31 UTC 2015
On 05/29/2015 01:17 PM, Laurent Charignon wrote:
> # HG changeset patch
> # User Laurent Charignon <lcharignon at fb.com>
> # Date 1432930312 25200
> # Fri May 29 13:11:52 2015 -0700
> # Node ID 395b1b8d437d7c47a8a8435fa16f42edd4ccd83d
> # Parent a4acf019dd5b72e91a1b1321d80d298033be8111
> revert: add an experimental config to use inverted selection
>
> We had a discussion on the list about the interactive ui for revert. This patch
> adds a flag to allow people to test the second alternative (referred to as
> proposition 2 on the mailing list). It effectively inverts the signs in the
> diff displayed to match the output of hg diff. A test is added to show an
> example.
>
> By setting the following flag in the config, one can try proposition 2:
> [experimental]
> invertedinteractive=True
>
> diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py
> --- a/mercurial/cmdutil.py
> +++ b/mercurial/cmdutil.py
> @@ -3138,10 +3138,21 @@
> diffopts = patch.difffeatureopts(repo.ui, whitespace=True)
> diffopts.nodates = True
> diffopts.git = True
> - diff = patch.diff(repo, None, ctx.node(), m, opts=diffopts)
> + reversehunks = repo.ui.configbool('experimental',
> + 'invertedinteractive',
> + False)
we probably want this to be called:
experimental.revertdiffmode= 'action', 'revert-diff'
(important point here: "use revert in the name", "allow multiple value",
feel free to come with anything).
We'll probably play with more than two modes while discussing this.
--
Pierre-Yves David
More information about the Mercurial-devel
mailing list