Patchwork [18,of,35,V2] context: move phasestr from changectx

login
register
mail settings
Submitter Sean Farley
Date Aug. 7, 2013, 11:51 p.m.
Message ID <620f658c14e4f1aa63cf.1375919492@laptop.local>
Download mbox | patch
Permalink /patch/2071/
State Accepted
Headers show

Comments

Sean Farley - Aug. 7, 2013, 11:51 p.m.
# HG changeset patch
# User Sean Farley <sean.michael.farley@gmail.com>
# Date 1375744744 18000
#      Mon Aug 05 18:19:04 2013 -0500
# Node ID 620f658c14e4f1aa63cff063e53ee14f65183da0
# Parent  c554222f8f11df8a7442c3925bf27ee45e8a06ea
context: move phasestr from changectx

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -73,10 +73,12 @@ 
         return self._node
     def hex(self):
         return hex(self.node())
     def manifest(self):
         return self._manifest
+    def phasestr(self):
+        return phases.phasenames[self.phase()]
 
 class changectx(context):
     """A changecontext object makes access to data related to a particular
     changeset convenient. It represents a read-only context already presnt in
     the repo."""
@@ -232,12 +234,10 @@ 
         return self._repo.nodetags(self._node)
     def bookmarks(self):
         return self._repo.nodebookmarks(self._node)
     def phase(self):
         return self._repo._phasecache.phase(self._repo, self._rev)
-    def phasestr(self):
-        return phases.phasenames[self.phase()]
     def mutable(self):
         return self.phase() > phases.public
     def hidden(self):
         return self._rev in repoview.filterrevs(self._repo, 'visible')