Mercurial > public > mercurial-scm > hg
comparison contrib/revsetbenchmarks.py @ 25543:36336cc8cfab
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))`.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Tue, 09 Jun 2015 23:45:34 -0700 |
parents | 6d937c49d935 |
children | e66f1707ba6c |
comparison
equal
deleted
inserted
replaced
25542:6d937c49d935 | 25543:36336cc8cfab |
---|---|
200 | 200 |
201 | 201 |
202 def applyvariants(revset, variant): | 202 def applyvariants(revset, variant): |
203 if variant == 'plain': | 203 if variant == 'plain': |
204 return revset | 204 return revset |
205 return '%s(%s)' % (variant, revset) | 205 for var in variant.split('+'): |
206 revset = '%s(%s)' % (var, revset) | |
207 return revset | |
206 | 208 |
207 | 209 |
208 parser = OptionParser(usage="usage: %prog [options] <revs>") | 210 parser = OptionParser(usage="usage: %prog [options] <revs>") |
209 parser.add_option("-f", "--file", | 211 parser.add_option("-f", "--file", |
210 help="read revset from FILE (stdin if omitted)", | 212 help="read revset from FILE (stdin if omitted)", |