[PATCH] repoview: add config knob to control if obsolescence hides changesets

Augie Fackler raf at durin42.com
Tue Apr 11 10:50:02 EDT 2017


On Tue, Apr 11, 2017 at 05:06:48AM -0700, Ryan McElroy wrote:
> # HG changeset patch
> # User Ryan McElroy <rmcelroy at fb.com>
> # Date 1491912379 25200
> #      Tue Apr 11 05:06:19 2017 -0700
> # Node ID 6cd79621e34389e294478068b072e09635eb3b78
> # Parent  e0dc40530c5aa514feb6a09cf79ab6a3aa2ec331
> repoview: add config knob to control if obsolescence hides changesets

We're getting close to the freeze, and I suspect the clients for this
will be ready to review early in the 4.3 cycle - any objection to
holding this until we unfreeze post 4.2?

>
> The idea here is to make it easy to test new concepts for hiding changesets
> that might be independent from the current system for hiding changesets.
> At the moment, setting this to False has similar behavior to passing --hidden
> to every hg command, but it also affects revsets like hidden() ibecause nothing
> is hidden by obsolescense markers with this configuration disabled.
>
> Full disclosure: when you have a repo with lots of hidden commits, it makes the
> user experience pretty bad today.
>
> diff --git a/mercurial/repoview.py b/mercurial/repoview.py
> --- a/mercurial/repoview.py
> +++ b/mercurial/repoview.py
> @@ -30,7 +30,10 @@ def hideablerevs(repo):
>      branchmap (see mercurial.branchmap.subsettable), you cannot set "public"
>      changesets as "hideable". Doing so would break multiple code assertions and
>      lead to crashes."""
> -    return obsolete.getrevs(repo, 'obsolete')
> +    hideable = set()
> +    if repo.ui.configbool('experimental', 'hideobsolete', True):
> +        hideable = obsolete.getrevs(repo, 'obsolete')
> +    return hideable
>
>  def _getstatichidden(repo):
>      """Revision to be hidden (disregarding dynamic blocker)
> diff --git a/tests/test-obsolete.t b/tests/test-obsolete.t
> --- a/tests/test-obsolete.t
> +++ b/tests/test-obsolete.t
> @@ -199,6 +199,11 @@ check that various commands work well wi
>    $ hg debugrevspec 'null'
>    -1
>
> +Check that hiddenness can be controled with configuaration
> +
> +  $ hg log -r 4 --config experimental.hideobsolete=False -T '{rev}\n'
> +  4
> +
>  Check that public changeset are not accounted as obsolete:
>
>    $ hg --hidden phase --public 2
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


More information about the Mercurial-devel mailing list