diff mercurial/revset.py @ 34457:2c3b8fa3211b

revset: add experimental support for extdata This is minimal and non-controversial implementation of extdata() revset. Originally extdata sources were exposed to the symbol namespace, but I've changed it to a plain function for simplicity.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 01 Oct 2017 10:50:00 +0100
parents b0790bebfcf8
children 39b094e4ae2c
line wrap: on
line diff
--- a/mercurial/revset.py	Tue Sep 13 14:14:05 2016 -0500
+++ b/mercurial/revset.py	Sun Oct 01 10:50:00 2017 +0100
@@ -786,6 +786,17 @@
     contentdivergent = obsmod.getrevs(repo, 'contentdivergent')
     return subset & contentdivergent
 
+@predicate('extdata(source)', safe=False, weight=100)
+def extdata(repo, subset, x):
+    """Changesets in the specified extdata source. (EXPERIMENTAL)"""
+    # i18n: "extdata" is a keyword
+    args = getargsdict(x, 'extdata', 'source')
+    source = getstring(args.get('source'),
+                       # i18n: "extdata" is a keyword
+                       _('extdata takes at least 1 string argument'))
+    data = scmutil.extdatasource(repo, source)
+    return subset & baseset(data)
+
 @predicate('extinct()', safe=True)
 def extinct(repo, subset, x):
     """Obsolete changesets with obsolete descendants only.