# HG changeset patch # User Pierre-Yves David # Date 2014-03-27 01:26:18 # Node ID 4130ec938c846629777e87ecbff0ed17b863710b # Parent d0c2535c7aba2d6c196f0d47a42874cc59f10ab9 revsetbenchmark: convert performance call to proper subprocess call diff --git a/contrib/revsetbenchmarks.py b/contrib/revsetbenchmarks.py --- a/contrib/revsetbenchmarks.py +++ b/contrib/revsetbenchmarks.py @@ -25,7 +25,15 @@ def update(rev): print >> sys.stderr, 'update to revision %s failed, aborting' % rev sys.exit(exc.returncode) -PERF="./hg --config extensions.perf=contrib/perf.py perfrevset" +def perf(revset): + """run benchmark for this very revset""" + try: + check_call(['./hg', '--config', 'extensions.perf=contrib/perf.py', + 'perfrevset', revset]) + except CalledProcessError, exc: + print >> sys.stderr, 'abort: cannot run revset benchmark' + sys.exit(exc.returncode) + target_rev = sys.argv[1] @@ -61,6 +69,6 @@ for r in revs: for idx, rset in enumerate(revsets): sys.stdout.write("%i) " % idx) sys.stdout.flush() - check_call(PERF + ' "%s"' % rset, shell=True) + perf(rset) print "----------------------------"