diff mercurial/phases.py @ 15818:57241845a4bb

phases: store phase values in constant instead of using raw integer Phases constant are named after the phase name. Usage of integer have been replaced by proper constant.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Fri, 06 Jan 2012 09:51:35 +0100
parents e34f4d1f0dbb
children e3ee8bf5d0cc
line wrap: on
line diff
--- a/mercurial/phases.py	Mon Jan 09 14:56:05 2012 +0100
+++ b/mercurial/phases.py	Fri Jan 06 09:51:35 2012 +0100
@@ -102,7 +102,7 @@
 from node import nullid, bin, hex, short
 from i18n import _
 
-allphases = range(3)
+allphases = public, draft, secret = range(3)
 trackedphases = allphases[1:]
 
 def readroots(repo):
@@ -242,7 +242,7 @@
 def visibleheads(repo):
     """return the set of visible head of this repo"""
     # XXX we want a cache on this
-    sroots = repo._phaseroots[2]
+    sroots = repo._phaseroots[secret]
     if sroots:
         # XXX very slow revset. storing heads or secret "boundary" would help.
         revset = repo.set('heads(not (%ln::))', sroots)