[PATCH 2 of 3 V4] repoview: add _gethiddenblockers method
Sean Farley
sean.michael.farley at gmail.com
Thu Apr 3 20:22:29 CDT 2014
# HG changeset patch
# User Sean Farley <sean.michael.farley at gmail.com>
# Date 1396573662 18000
# Thu Apr 03 20:07:42 2014 -0500
# Node ID fb7fd3f4533923299d52f2d64efce39b91a40ab7
# Parent 9ffeca13668d408d58490682492fc372603a2712
repoview: add _gethiddenblockers method
This is a standalone function that will provide the ability for extensions to
wrap.
diff --git a/mercurial/repoview.py b/mercurial/repoview.py
--- a/mercurial/repoview.py
+++ b/mercurial/repoview.py
@@ -17,10 +17,35 @@ def hideablerevs(repo):
"""Revisions candidates to be hidden
This is a standalone function to help extensions to wrap it."""
return obsolete.getrevs(repo, 'obsolete')
+def _gethiddenblockers(repo):
+ """Get revisions that will block hidden changesets from being filtered
+
+ This is a standalone function to help extensions to wrap it."""
+ assert not repo.changelog.filteredrevs
+ hideable = hideablerevs(repo)
+ blockers = []
+ 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())
+ blockers.extend(repo[t].rev() for t in tags)
+ return blockers
+
def computehidden(repo):
"""compute the set of hidden revision to filter
During most operation hidden should be filtered."""
assert not repo.changelog.filteredrevs
More information about the Mercurial-devel
mailing list