repoview: use _gethiddenblockers in computehidden
authorSean Farley <sean.michael.farley@gmail.com>
Fri, 28 Mar 2014 12:51:05 -0500
changeset 20941 c79503f7adac
parent 20940 b0822c23e80a
child 20942 3737e653dcbe
repoview: use _gethiddenblockers in computehidden No functionality has changed, since we've only extracted the code into its own function. Now extensions can wrap _gethiddenblockers to provide their own blocker without polluting bookmarks or local tags.
mercurial/repoview.py
--- a/mercurial/repoview.py	Thu Apr 03 20:07:42 2014 -0500
+++ b/mercurial/repoview.py	Fri Mar 28 12:51:05 2014 -0500
@@ -52,20 +52,7 @@
     hideable = hideablerevs(repo)
     if hideable:
         cl = repo.changelog
-        firsthideable = min(hideable)
-        revs = cl.revs(start=firsthideable)
-        tofilter = repo.revs(
-            '(%ld) and children(%ld)', list(revs), list(hideable))
-        blockers = [r for r in tofilter if r not in hideable]
-        for par in repo[None].parents():
-            blockers.append(par.rev())
-        for bm in repo._bookmarks.values():
-            blockers.append(repo[bm].rev())
-        tags = {}
-        tagsmod.readlocaltags(repo.ui, repo, tags, {})
-        if tags:
-            blockers.extend(repo[t[0]].rev() for t in tags.values())
-        blocked = cl.ancestors(blockers, inclusive=True)
+        blocked = cl.ancestors(_gethiddenblockers(repo), inclusive=True)
         return frozenset(r for r in hideable if r not in blocked)
     return frozenset()