diff hgext/obsolete.py @ 148:8e93e1f67205

obsolete: define an unstable property on context
author Pierre-Yves David <pierre-yves.david@logilab.fr>
date Tue, 20 Mar 2012 10:39:07 +0100
parents f387658d6d22
children f12fd2410a60
line wrap: on
line diff
--- a/hgext/obsolete.py	Tue Mar 20 10:38:38 2012 +0100
+++ b/hgext/obsolete.py	Tue Mar 20 10:39:07 2012 +0100
@@ -109,6 +109,14 @@
 
 context.changectx.obsolete = obsolete
 
+def unstable(ctx):
+    """is the changeset unstable (have obsolete ancestor)"""
+    if ctx.node() is None:
+        return False
+    return ctx.rev() in ctx._repo._unstableset
+
+context.changectx.unstable = unstable
+
 
 ### revset
 #############################