Patchwork [9,of,9,V3] repoview: use _gethiddenblockers in computehidden

login
register
mail settings
Submitter Sean Farley
Date March 28, 2014, 10:06 p.m.
Message ID <f979d5fd10059349d3cd.1396044367@laptop.local>
Download mbox | patch
Permalink /patch/4116/
State Superseded
Commit c79503f7adac7b656eca715bca48503b0232876f
Headers show

Comments

Sean Farley - March 28, 2014, 10:06 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1396029065 18000
#      Fri Mar 28 12:51:05 2014 -0500
# Node ID f979d5fd10059349d3cdb13e7eb91574e342f2a9
# Parent  e2f87be23b410518a1d3d63931c976ad05bfd0a5
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.

Patch

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -46,22 +46,11 @@  def computehidden(repo):
     During most operation hidden should be filtered."""
     assert not repo.changelog.filteredrevs
     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 = [n for t, n in repo.localtags().iteritems()]
-        blockers.extend(repo[t].rev() for t in tags)
-        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()
 
 def computeunserved(repo):
     """compute the set of revision that should be filtered when used a server