changeset 15707:dc3eefe0c80e

phases: implement ``phase()`` and ``hidden()`` method for workingctx Working ctx don't have revision number and need a dedicated implementation.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Wed, 21 Dec 2011 23:56:15 +0100
parents ebaefd8c6028
children 309e49491253
files mercurial/context.py
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Tue Dec 20 01:31:25 2011 +0100
+++ b/mercurial/context.py	Wed Dec 21 23:56:15 2011 +0100
@@ -805,6 +805,15 @@
             b.extend(p.bookmarks())
         return b
 
+    def phase(self):
+        phase = 1 # default phase to draft
+        for p in self.parents():
+            phase = max(phase, p.phase())
+        return phase
+
+    def hidden(self):
+        return False
+
     def children(self):
         return []