phases: implement ``phase()`` and ``hidden()`` method for workingctx
Working ctx don't have revision number and need a dedicated implementation.
--- 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 []