Patchwork [2,of,9,v2] hidden: rename "revealedrevs" to "pinnedrevs"

login
register
mail settings
Submitter via Mercurial-devel
Date May 30, 2017, 8:29 p.m.
Message ID <eb935934cf29ce92db4c.1496176169@martinvonz.svl.corp.google.com>
Download mbox | patch
Permalink /patch/21076/
State Accepted
Headers show

Comments

via Mercurial-devel - May 30, 2017, 8:29 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1495944531 25200
#      Sat May 27 21:08:51 2017 -0700
# Node ID eb935934cf29ce92db4c9cd11f76e4758ee9e3c3
# Parent  568558acf7efd7d4ffd8f44a5bf29c92f5d6a2ba
hidden: rename "revealedrevs" to "pinnedrevs"

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.).

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -1537,4 +1537,4 @@ 
     cmdutil.afterresolvedstates.append(
         ['rebasestate', _('hg rebase --continue')])
     # ensure rebased rev are not hidden
-    extensions.wrapfunction(repoview, 'revealedrevs', _rebasedvisible)
+    extensions.wrapfunction(repoview, 'pinnedrevs', _rebasedvisible)
diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -28,21 +28,21 @@ 
     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
@@ -112,7 +112,7 @@ 
 
         # 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)