Patchwork [7,of,7,V2] repoview: use _gethiddenblockers in computehidden

login
register
mail settings
Submitter Sean Farley
Date March 28, 2014, 5:53 p.m.
Message ID <42b302e1272c68c7670d.1396029201@laptop.local>
Download mbox | patch
Permalink /patch/4107/
State Superseded
Commit c79503f7adac7b656eca715bca48503b0232876f
Headers show

Comments

Sean Farley - March 28, 2014, 5:53 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 42b302e1272c68c7670de2a5e79d48579ed60599
# Parent  6d11b3a77ddd1f311a6810844f8a3de948563097
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