[PATCH 2 of 3] context: add obsoletestr

Romain DEP. rom1dep at gmail.com
Tue Jan 6 03:47:36 CST 2015


# HG changeset patch
# User Sean Farley <sean.michael.farley at gmail.com>
# Date 1420411181 -3600
#      Sun Jan 04 23:39:41 2015 +0100
# Node ID 76d3ce984a461e7c95a83840f8012210b8c9b531
# Parent  7a73c8aa23c3d403008b7327de082567fc5705d2
context: add obsoletestr

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -187,6 +187,11 @@
         """True if the changeset is obsolete"""
         return self.rev() in obsmod.getrevs(self._repo, 'obsolete')
 
+    def obsoletestr(self):
+        if self.obsolete():
+            return 'obsolete'
+        return 'nonobsolete'
+
     def extinct(self):
         """True if the changeset is extinct"""
         return self.rev() in obsmod.getrevs(self._repo, 'extinct')


More information about the Mercurial-devel mailing list