diff mercurial/repoview.py @ 32612:47e4c6bb39f1

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.).
author Martin von Zweigbergk <martinvonz@google.com>
date Sat, 27 May 2017 21:08:51 -0700
parents bceb398e6d72
children b9b41d8f4522
line wrap: on
line diff
--- a/mercurial/repoview.py	Sat May 27 21:02:17 2017 -0700
+++ b/mercurial/repoview.py	Sat May 27 21:08:51 2017 -0700
@@ -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)