# HG changeset patch # User Pierre-Yves David # Date 2011-12-21 22:56:15 # Node ID dc3eefe0c80e1a793f842a26b2ac3b199db7b9f0 # Parent ebaefd8c6028fb2924292a02a09d14f64614a6f7 phases: implement ``phase()`` and ``hidden()`` method for workingctx Working ctx don't have revision number and need a dedicated implementation. diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -805,6 +805,15 @@ class workingctx(changectx): 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 []