Mercurial > hg
changeset 33129:765c6ab07a88
obsolete: provide a small function to retrieve all mutable revisions
More obsolescence related algorithm focus on the mutable revision. We provide a
tiny utility function to make it easy to access this set.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Sun, 18 Jun 2017 22:38:11 +0200 |
parents | 126eae7dae74 |
children | 31ab1912678a |
files | mercurial/obsolete.py |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/obsolete.py Tue Jun 27 14:38:00 2017 -0700 +++ b/mercurial/obsolete.py Sun Jun 18 22:38:11 2017 +0200 @@ -1309,11 +1309,15 @@ if 'obsstore' in repo._filecache: repo.obsstore.caches.clear() +def _mutablerevs(repo): + """the set of mutable revision in the repository""" + return repo._phasecache.getrevset(repo, (phases.draft, phases.secret)) + @cachefor('obsolete') def _computeobsoleteset(repo): """the set of obsolete revisions""" getnode = repo.changelog.node - notpublic = repo._phasecache.getrevset(repo, (phases.draft, phases.secret)) + notpublic = _mutablerevs(repo) isobs = repo.obsstore.successors.__contains__ obs = set(r for r in notpublic if isobs(getnode(r))) return obs