Submitter | Ryan McElroy |
---|---|
Date | April 11, 2017, 12:06 p.m. |
Message ID | <6cd79621e34389e29447.1491912408@devbig314.prn1.facebook.com> |
Download | mbox | patch |
Permalink | /patch/20102/ |
State | Deferred |
Headers | show |
Comments
On Tue, Apr 11, 2017 at 05:06:48AM -0700, Ryan McElroy wrote: > # HG changeset patch > # User Ryan McElroy <rmcelroy@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@mercurial-scm.org > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
On 4/11/17 3:50 PM, Augie Fackler wrote: > On Tue, Apr 11, 2017 at 05:06:48AM -0700, Ryan McElroy wrote: >> # HG changeset patch >> # User Ryan McElroy <rmcelroy@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? No objection at all. I sent this after a meeting I had with Pierre-Yves this morning to start playing around with some of these concepts, but I agree that there's no rush here. I'll drop it from patchwork if that hasn't been done already. > >> 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 >>
Patch
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