# HG changeset patch # User Pierre-Yves David # Date 1332236347 -3600 # Node ID 8e93e1f67205cef9d86cfcb0ef56dca396f5f61b # Parent b0b23d9eede5714d3097d53cefacd62515bdc5f4 obsolete: define an unstable property on context diff -r b0b23d9eede5 -r 8e93e1f67205 hgext/obsolete.py --- 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 #############################