comparison mercurial/repoview.py @ 32427:8db2feb04ceb

repoview: rename '_getdynamicblockers' to 'revealedrevs' (API) Recent mailing list discussion made me realised we could clarify these. We make the function "public" to encourage extensions to wrap it and we use a more explicit name that mirror "hideablerevs".
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 20 May 2017 19:43:58 +0200
parents 06aa645e2372
children 1d70ec85ae00
comparison
equal deleted inserted replaced
32426:06aa645e2372 32427:8db2feb04ceb
30 branchmap (see mercurial.branchmap.subsettable), you cannot set "public" 30 branchmap (see mercurial.branchmap.subsettable), you cannot set "public"
31 changesets as "hideable". Doing so would break multiple code assertions and 31 changesets as "hideable". Doing so would break multiple code assertions and
32 lead to crashes.""" 32 lead to crashes."""
33 return obsolete.getrevs(repo, 'obsolete') 33 return obsolete.getrevs(repo, 'obsolete')
34 34
35 def _getdynamicblockers(repo): 35 def revealedrevs(repo):
36 """Non-cacheable revisions blocking hidden changesets from being filtered. 36 """Non-cacheable revisions blocking hidden changesets from being filtered.
37 37
38 Get revisions that will block hidden changesets and are likely to change, 38 Get revisions that will block hidden changesets and are likely to change,
39 but unlikely to create hidden blockers. They won't be cached, so be careful 39 but unlikely to create hidden blockers. They won't be cached, so be careful
40 with adding additional computation.""" 40 with adding additional computation."""
183 hidden = frozenset(_getstatichidden(repo)) 183 hidden = frozenset(_getstatichidden(repo))
184 trywritehiddencache(repo, hideable, hidden) 184 trywritehiddencache(repo, hideable, hidden)
185 185
186 # check if we have wd parents, bookmarks or tags pointing to hidden 186 # check if we have wd parents, bookmarks or tags pointing to hidden
187 # changesets and remove those. 187 # changesets and remove those.
188 dynamic = hidden & _getdynamicblockers(repo) 188 dynamic = hidden & revealedrevs(repo)
189 if dynamic: 189 if dynamic:
190 blocked = cl.ancestors(dynamic, inclusive=True) 190 blocked = cl.ancestors(dynamic, inclusive=True)
191 hidden = frozenset(r for r in hidden if r not in blocked) 191 hidden = frozenset(r for r in hidden if r not in blocked)
192 return hidden 192 return hidden
193 193