mercurial/revset.py
changeset 17173 c621f84dbb35
parent 17171 9c750c3e4fac
child 17185 2c7c4824969e
--- a/mercurial/revset.py	Tue Jul 10 01:39:03 2012 +0200
+++ b/mercurial/revset.py	Fri Jul 06 19:34:09 2012 +0200
@@ -568,6 +568,13 @@
     pc = repo._phasecache
     return [r for r in subset if pc.phase(repo, r) == phases.draft]
 
+def extinct(repo, subset, x):
+    """``extinct()``
+    obsolete changeset with obsolete descendant only."""
+    getargs(x, 0, 0, _("obsolete takes no arguments"))
+    extinctset = set(repo.revs('(obsolete()::) - (::(not obsolete()))'))
+    return [r for r in subset if r in extinctset]
+
 def extra(repo, subset, x):
     """``extra(label, [value])``
     Changesets with the given label in the extra metadata, with the given
@@ -1365,6 +1372,7 @@
     "descendants": descendants,
     "_firstdescendants": _firstdescendants,
     "draft": draft,
+    "extinct": extinct,
     "extra": extra,
     "file": hasfile,
     "filelog": filelog,