Show More
@@ -53,10 +53,13 b' def hg(cmd, repo=None):' | |||||
53 | fullcmd += cmd |
|
53 | fullcmd += cmd | |
54 | return check_output(fullcmd, stderr=STDOUT) |
|
54 | return check_output(fullcmd, stderr=STDOUT) | |
55 |
|
55 | |||
56 | def perf(revset, target=None): |
|
56 | def perf(revset, target=None, contexts=False): | |
57 | """run benchmark for this very revset""" |
|
57 | """run benchmark for this very revset""" | |
58 | try: |
|
58 | try: | |
59 |
|
|
59 | args = ['perfrevset', revset] | |
|
60 | if contexts: | |||
|
61 | args.append('--contexts') | |||
|
62 | output = hg(args, repo=target) | |||
60 | return parseoutput(output) |
|
63 | return parseoutput(output) | |
61 | except CalledProcessError as exc: |
|
64 | except CalledProcessError as exc: | |
62 | print >> sys.stderr, 'abort: cannot run revset benchmark: %s' % exc.cmd |
|
65 | print >> sys.stderr, 'abort: cannot run revset benchmark: %s' % exc.cmd | |
@@ -238,6 +241,9 b' parser.add_option("", "--variants",' | |||||
238 | default=','.join(DEFAULTVARIANTS), |
|
241 | default=','.join(DEFAULTVARIANTS), | |
239 | help="comma separated list of variant to test " |
|
242 | help="comma separated list of variant to test " | |
240 | "(eg: plain,min,sorted) (plain = no modification)") |
|
243 | "(eg: plain,min,sorted) (plain = no modification)") | |
|
244 | parser.add_option('', '--contexts', | |||
|
245 | action='store_true', | |||
|
246 | help='obtain changectx from results instead of integer revs') | |||
241 |
|
247 | |||
242 | (options, args) = parser.parse_args() |
|
248 | (options, args) = parser.parse_args() | |
243 |
|
249 | |||
@@ -283,7 +289,7 b' for r in revs:' | |||||
283 | varres = {} |
|
289 | varres = {} | |
284 | for var in variants: |
|
290 | for var in variants: | |
285 | varrset = applyvariants(rset, var) |
|
291 | varrset = applyvariants(rset, var) | |
286 | data = perf(varrset, target=options.repo) |
|
292 | data = perf(varrset, target=options.repo, contexts=options.contexts) | |
287 | varres[var] = data |
|
293 | varres[var] = data | |
288 | res.append(varres) |
|
294 | res.append(varres) | |
289 | printresult(variants, idx, varres, len(revsets), |
|
295 | printresult(variants, idx, varres, len(revsets), |
General Comments 0
You need to be logged in to leave comments.
Login now