hidden: rename "revealedrevs" to "pinnedrevs" (API)
authorMartin von Zweigbergk <martinvonz@google.com>
Sat, 27 May 2017 21:08:51 -0700
changeset 37799 47e4c6bb39f1ce462ba33b964258c086a5949f09
parent 37798 bceb398e6d72eb5a0ed0022bc019136dbc81be1f
child 37800 b9b41d8f45224bb223c61029c478c6f9727384f8
push id525
push usergszorc@mozilla.com
push dateFri, 09 Jun 2017 06:37:32 +0000
hidden: rename "revealedrevs" to "pinnedrevs" (API) E.g. tags and bookmarks can reveal revisions that would otherwise be hidden. A revision can also be revealed because one if its descendants is visible. Let's use the term "pinned" for the former case (bookmarks etc.).
hgext/rebase.py
mercurial/repoview.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -1532,9 +1532,9 @@ def uisetup(ui):
                      _("specify merge tool for rebase")))
     cmdutil.summaryhooks.add('rebase', summaryhook)
     cmdutil.unfinishedstates.append(
         ['rebasestate', False, False, _('rebase in progress'),
          _("use 'hg rebase --continue' or 'hg rebase --abort'")])
     cmdutil.afterresolvedstates.append(
         ['rebasestate', _('hg rebase --continue')])
     # ensure rebased rev are not hidden
-    extensions.wrapfunction(repoview, 'revealedrevs', _rebasedvisible)
+    extensions.wrapfunction(repoview, 'pinnedrevs', _rebasedvisible)
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -23,31 +23,31 @@ def hideablerevs(repo):
     This is a standalone function to allow extensions to wrap it.
 
     Because we use the set of immutable changesets as a fallback subset in
     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')
 
-def revealedrevs(repo):
+def pinnedrevs(repo):
     """revisions blocking hidden changesets from being filtered
     """
 
     cl = repo.changelog
-    blockers = set()
-    blockers.update([par.rev() for par in repo[None].parents()])
-    blockers.update([cl.rev(bm) for bm in repo._bookmarks.values()])
+    pinned = set()
+    pinned.update([par.rev() for par in repo[None].parents()])
+    pinned.update([cl.rev(bm) for bm in repo._bookmarks.values()])
 
     tags = {}
     tagsmod.readlocaltags(repo.ui, repo, tags, {})
     if tags:
         rev, nodemap = cl.rev, cl.nodemap
-        blockers.update(rev(t[0]) for t in tags.values() if t[0] in nodemap)
-    return blockers
+        pinned.update(rev(t[0]) for t in tags.values() if t[0] in nodemap)
+    return pinned
 
 def _consistencyblocker(pfunc, hideable, domain):
     """return non-hideable changeset blocking hideable one
 
     For consistency, we cannot actually hide a changeset if one of it children
     are visible, this function find such children.
     """
     others = domain - hideable
@@ -107,17 +107,17 @@ def computehidden(repo):
         pfunc = repo.changelog.parentrevs
         mutablephases = (phases.draft, phases.secret)
         mutable = repo._phasecache.getrevset(repo, mutablephases)
 
         blockers = _consistencyblocker(pfunc, hidden, mutable)
 
         # check if we have wd parents, bookmarks or tags pointing to hidden
         # changesets and remove those.
-        blockers |= (hidden & revealedrevs(repo))
+        blockers |= (hidden & pinnedrevs(repo))
         if blockers:
             hidden = hidden - _domainancestors(pfunc, blockers, mutable)
     return frozenset(hidden)
 
 def computeunserved(repo):
     """compute the set of revision that should be filtered when used a server
 
     Secret and hidden changeset should not pretend to be here."""