Mercurial > hg
changeset 20851:4130ec938c84
revsetbenchmark: convert performance call to proper subprocess call
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Wed, 26 Mar 2014 18:26:18 -0700 |
parents | d0c2535c7aba |
children | b2353501d6dc |
files | contrib/revsetbenchmarks.py |
diffstat | 1 files changed, 10 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/contrib/revsetbenchmarks.py Wed Mar 26 18:14:15 2014 -0700 +++ b/contrib/revsetbenchmarks.py Wed Mar 26 18:26:18 2014 -0700 @@ -25,7 +25,15 @@ 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 idx, rset in enumerate(revsets): sys.stdout.write("%i) " % idx) sys.stdout.flush() - check_call(PERF + ' "%s"' % rset, shell=True) + perf(rset) print "----------------------------"