changeset 38191:4e790f0966fc

phases: define an official tuple of phases we do not share Same motivation as for `mutablephases`, having a single definition helps with updating phases logic.
author Boris Feld <boris.feld@octobus.net>
date Tue, 22 May 2018 18:10:37 +0200
parents 02f992ac26e9
children dea3903175ee
files mercurial/phases.py mercurial/repoview.py
diffstat 2 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/phases.py	Tue May 22 18:10:00 2018 +0200
+++ b/mercurial/phases.py	Tue May 22 18:10:37 2018 +0200
@@ -127,6 +127,7 @@
 trackedphases = allphases[1:]
 phasenames = ['public', 'draft', 'secret']
 mutablephases = tuple(allphases[1:])
+remotehiddenphases = tuple(allphases[2:])
 
 def _readroots(repo, phasedefaults=None):
     """Read phase roots from disk
--- a/mercurial/repoview.py	Tue May 22 18:10:00 2018 +0200
+++ b/mercurial/repoview.py	Tue May 22 18:10:37 2018 +0200
@@ -91,8 +91,8 @@
     # fast path in simple case to avoid impact of non optimised code
     hiddens = filterrevs(repo, 'visible')
     if phases.hassecret(repo):
-        secrets = frozenset(repo._phasecache.getrevset(repo, (phases.secret,)))
-        return frozenset(hiddens | secrets)
+        secrets = repo._phasecache.getrevset(repo, phases.remotehiddenphases)
+        return frozenset(hiddens | frozenset(secrets))
     else:
         return hiddens