changeset 20498:fb2df4506c87

revset: add an undocumented _missingancestors function This will be used in an upcoming patch to optimize expressions of the form (::x - ::y).
author Siddharth Agarwal <sid0@fb.com>
date Thu, 13 Feb 2014 13:54:45 -0800
parents 19b1c62cee1c
children 2efd608473fb
files mercurial/revset.py
diffstat 1 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revset.py	Thu Feb 13 13:52:45 2014 -0800
+++ b/mercurial/revset.py	Thu Feb 13 13:54:45 2014 -0800
@@ -1021,6 +1021,16 @@
             return baseset([m])
     return baseset([])
 
+def _missingancestors(repo, subset, x):
+    # i18n: "_missingancestors" is a keyword
+    revs, bases = getargs(x, 2, 2,
+                          _("_missingancestors requires two arguments"))
+    rs = baseset(repo)
+    revs = getset(repo, rs, revs)
+    bases = getset(repo, rs, bases)
+    missing = set(repo.changelog.findmissingrevs(bases, revs))
+    return baseset([r for r in subset if r in missing])
+
 def modifies(repo, subset, x):
     """``modifies(pattern)``
     Changesets modifying files matched by pattern.
@@ -1602,6 +1612,7 @@
     "max": maxrev,
     "merge": merge,
     "min": minrev,
+    "_missingancestors": _missingancestors,
     "modifies": modifies,
     "obsolete": obsolete,
     "origin": origin,
@@ -1671,6 +1682,7 @@
     "max",
     "merge",
     "min",
+    "_missingancestors",
     "modifies",
     "obsolete",
     "origin",