obsolete: add an extinct property on context
authorPierre-Yves David <pierre-yves.david@logilab.fr>
Tue, 24 Apr 2012 15:56:31 +0200
changeset 213 ea4aa1890b16
parent 212 cd9407400ced
child 214 a140d1857931
obsolete: add an extinct property on context
hgext/obsolete.py
--- a/hgext/obsolete.py	Tue Apr 24 15:58:19 2012 +0200
+++ b/hgext/obsolete.py	Tue Apr 24 15:56:31 2012 +0200
@@ -125,6 +125,14 @@
 
 context.changectx.unstable = unstable
 
+def extinct(ctx):
+    """is the changeset extinct by other"""
+    if ctx.node() is None:
+        return False
+    return ctx.rev() in ctx._repo._extinctset
+
+context.changectx.extinct = extinct
+
 
 ### revset
 #############################