changeset 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 b0b23d9eede5
children 03f314e32058
files hgext/obsolete.py
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
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
 #############################