revsetbenchmarks: support combining variants with "+"
authorPierre-Yves David <pierre-yves.david@fb.com>
Tue, 09 Jun 2015 23:45:34 -0700
changeset 25543 36336cc8cfab
parent 25542 6d937c49d935
child 25544 e66f1707ba6c
revsetbenchmarks: support combining variants with "+" We need more advanced variants in some cases. For example, "The last rev of the sorted version". We introduce a syntax for this: `reverse+last` means `last(reverse(REVSET))`.
contrib/revsetbenchmarks.py
--- a/contrib/revsetbenchmarks.py	Tue Jun 09 21:10:44 2015 -0700
+++ b/contrib/revsetbenchmarks.py	Tue Jun 09 23:45:34 2015 -0700
@@ -202,7 +202,9 @@
 def applyvariants(revset, variant):
     if variant == 'plain':
         return revset
-    return '%s(%s)' % (variant, revset)
+    for var in variant.split('+'):
+        revset = '%s(%s)' % (var, revset)
+    return revset
 
 
 parser = OptionParser(usage="usage: %prog [options] <revs>")