Mercurial > hg
changeset 32426:06aa645e2372
repoview: move '_getdynamicblock' next to 'hideablerevs'
There are the two functions that extensions should use to augment the hidding
logic. It seem better to have them together at the top of the file.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sat, 20 May 2017 19:43:29 +0200 |
parents | 397e3a2e9347 |
children | 8db2feb04ceb |
files | mercurial/repoview.py |
diffstat | 1 files changed, 19 insertions(+), 19 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/repoview.py Sun May 21 13:26:17 2017 -0700 +++ b/mercurial/repoview.py Sat May 20 19:43:29 2017 +0200 @@ -32,6 +32,25 @@ lead to crashes.""" return obsolete.getrevs(repo, 'obsolete') +def _getdynamicblockers(repo): + """Non-cacheable revisions blocking hidden changesets from being filtered. + + Get revisions that will block hidden changesets and are likely to change, + but unlikely to create hidden blockers. They won't be cached, so be careful + with adding additional computation.""" + + cl = repo.changelog + blockers = set() + blockers.update([par.rev() for par in repo[None].parents()]) + blockers.update([cl.rev(bm) for bm in repo._bookmarks.values()]) + + tags = {} + tagsmod.readlocaltags(repo.ui, repo, tags, {}) + if tags: + rev, nodemap = cl.rev, cl.nodemap + blockers.update(rev(t[0]) for t in tags.values() if t[0] in nodemap) + return blockers + def _getstatichidden(repo): """Revision to be hidden (disregarding dynamic blocker) @@ -73,25 +92,6 @@ heappush(heap, -parent) return hidden -def _getdynamicblockers(repo): - """Non-cacheable revisions blocking hidden changesets from being filtered. - - Get revisions that will block hidden changesets and are likely to change, - but unlikely to create hidden blockers. They won't be cached, so be careful - with adding additional computation.""" - - cl = repo.changelog - blockers = set() - blockers.update([par.rev() for par in repo[None].parents()]) - blockers.update([cl.rev(bm) for bm in repo._bookmarks.values()]) - - tags = {} - tagsmod.readlocaltags(repo.ui, repo, tags, {}) - if tags: - rev, nodemap = cl.rev, cl.nodemap - blockers.update(rev(t[0]) for t in tags.values() if t[0] in nodemap) - return blockers - cacheversion = 1 cachefile = 'cache/hidden'