[PATCH 3 of 6 OBSOLETE-MARKERS] context: add `obsolete` property on context

Pierre-Yves David pierre-yves.david at ens-lyon.org
Sat May 12 12:08:51 CDT 2012


# HG changeset patch
# User Pierre-Yves.David at ens-lyon.org
# Date 1336837189 -7200
# Node ID e89cc71b7fa9f33de4f8decb941ef0d719fdcb62
# Parent  42dd37168856ca2f3459ca29b318f0278bf68205
context: add `obsolete` property on context

This property return True if the changeset is obsoleted by any marker.

diff -r 42dd37168856 -r e89cc71b7fa9 mercurial/context.py
--- a/mercurial/context.py	Sat May 12 17:31:37 2012 +0200
+++ b/mercurial/context.py	Sat May 12 17:39:49 2012 +0200
@@ -229,6 +229,10 @@
         for d in self._repo.changelog.descendants(self._rev):
             yield changectx(self._repo, d)
 
+    def obsolete(self):
+        """True if the changeset is obsolete"""
+        return self.node() in self._repo.obsstore.obsoleted
+
     def _fileinfo(self, path):
         if '_manifest' in self.__dict__:
             try:


More information about the Mercurial-devel mailing list