Patchwork [3,of,3,V4] repoview: use _gethiddenblockers in computehidden

login
register
mail settings
Submitter Sean Farley
Date April 4, 2014, 1:22 a.m.
Message ID <784dedc175b0f595e45d.1396574550@laptop.local>
Download mbox | patch
Permalink /patch/4220/
State Accepted
Commit c79503f7adac7b656eca715bca48503b0232876f
Headers show

Comments

Sean Farley - April 4, 2014, 1:22 a.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 784dedc175b0f595e45dfac01c9f41a576e26a73
# Parent  fb7fd3f4533923299d52f2d64efce39b91a40ab7
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.
Matt Mackall - April 4, 2014, 6:31 p.m.
On Thu, 2014-04-03 at 20:22 -0500, Sean Farley wrote:
> # HG changeset patch
> # User Sean Farley <sean.michael.farley@gmail.com>
> # Date 1396029065 18000
> #      Fri Mar 28 12:51:05 2014 -0500
> # Node ID 784dedc175b0f595e45dfac01c9f41a576e26a73
> # Parent  fb7fd3f4533923299d52f2d64efce39b91a40ab7
> repoview: use _gethiddenblockers in computehidden

Looks good, queued for default.

Patch

diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -50,24 +50,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 = {}
-        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()
 
 def computeunserved(repo):
     """compute the set of revision that should be filtered when used a server