[PATCH 1 of 9 phases] phases: add a phasestr method on context

Pierre-Yves David pierre-yves.david at ens-lyon.org
Wed Jan 4 19:25:38 CST 2012


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1325130009 -3600
# Node ID f6f960709a0373f1163bd7d60944c6656de9493d
# Parent  e2a8777c92bd878fb52add317c0dd1ab7e56dc80
phases: add a phasestr method on context

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -7,7 +7,7 @@
 
 from node import nullid, nullrev, short, hex
 from i18n import _
-from phases import public, draft
+from phases import public, draft, phasenames
 import ancestor, mdiff, error, util, scmutil, subrepo, patch, encoding
 import match as matchmod
 import os, errno, stat
@@ -125,6 +125,8 @@
             # outdated cache
             del self._repo._phaserev
         return self._repo._phaserev[self._rev]
+    def phasestr(self):
+        return phasenames[self.phase()]
     def mutable(self):
         return self._repo._phaserev[self._rev] > public
     def hidden(self):


More information about the Mercurial-devel mailing list