Patchwork [2,of,8] repoview: rename '_getdynamicblockers' to 'revealedrevs'

login
register
mail settings
Submitter Pierre-Yves David
Date May 21, 2017, 3:20 p.m.
Message ID <acd7e055dbcb5830de63.1495380037@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/20789/
State Accepted
Headers show

Comments

Pierre-Yves David - May 21, 2017, 3:20 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1495302238 -7200
#      Sat May 20 19:43:58 2017 +0200
# Node ID acd7e055dbcb5830de634f52971a39dc654d73e1
# Parent  f9c309c4b8d22e0f0a9514f9cd6c4f2096e650be
# EXP-Topic dynamicblocker
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r acd7e055dbcb
repoview: rename '_getdynamicblockers' to 'revealedrevs'

Recent mailing list discussion made me realised we could clarify these. We make
the function "public" to encourage extensions to wrap it and we use a more
explicit name that mirror "hideablerevs".
Augie Fackler - May 22, 2017, 10:06 p.m.
On Sun, May 21, 2017 at 05:20:37PM +0200, Pierre-Yves David wrote:
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@octobus.net>
> # Date 1495302238 -7200
> #      Sat May 20 19:43:58 2017 +0200
> # Node ID acd7e055dbcb5830de634f52971a39dc654d73e1
> # Parent  f9c309c4b8d22e0f0a9514f9cd6c4f2096e650be
> # EXP-Topic dynamicblocker
> # Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
> #              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r acd7e055dbcb
> repoview: rename '_getdynamicblockers' to 'revealedrevs'

queued patches 1 and 2 (added (API) to 2), thanks

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -1537,4 +1537,4 @@  def uisetup(ui):
     cmdutil.afterresolvedstates.append(
         ['rebasestate', _('hg rebase --continue')])
     # ensure rebased rev are not hidden
-    extensions.wrapfunction(repoview, '_getdynamicblockers', _rebasedvisible)
+    extensions.wrapfunction(repoview, 'revealedrevs', _rebasedvisible)
diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -32,7 +32,7 @@  def hideablerevs(repo):
     lead to crashes."""
     return obsolete.getrevs(repo, 'obsolete')
 
-def _getdynamicblockers(repo):
+def revealedrevs(repo):
     """Non-cacheable revisions blocking hidden changesets from being filtered.
 
     Get revisions that will block hidden changesets and are likely to change,
@@ -185,7 +185,7 @@  def computehidden(repo):
 
         # check if we have wd parents, bookmarks or tags pointing to hidden
         # changesets and remove those.
-        dynamic = hidden & _getdynamicblockers(repo)
+        dynamic = hidden & revealedrevs(repo)
         if dynamic:
             blocked = cl.ancestors(dynamic, inclusive=True)
             hidden = frozenset(r for r in hidden if r not in blocked)