obsolete: define an unstable property on context
diff --git a/hgext/obsolete.py b/hgext/obsolete.py --- a/hgext/obsolete.py +++ b/hgext/obsolete.py @@ -109,6 +109,14 @@ def obsolete(ctx): 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 #############################