# HG changeset patch # User Pierre-Yves David # Date 1395882855 25200 # Node ID d0c2535c7aba2d6c196f0d47a42874cc59f10ab9 # Parent 5abc2562106a6eaeafb88ed73c1812d3c6239fd8 revsetbenchmark: convert update to proper subprocess call diff -r 5abc2562106a -r d0c2535c7aba contrib/revsetbenchmarks.py --- a/contrib/revsetbenchmarks.py Thu Mar 27 16:52:24 2014 -0500 +++ b/contrib/revsetbenchmarks.py Wed Mar 26 18:14:15 2014 -0700 @@ -14,9 +14,17 @@ # to compare performance. import sys -from subprocess import check_call, check_output +from subprocess import check_call, check_output, CalledProcessError + -HG="hg update --quiet --check" +def update(rev): + """update the repo to a revision""" + try: + check_call(['hg', 'update', '--quiet', '--check', str(rev)]) + except CalledProcessError, exc: + print >> sys.stderr, 'update to revision %s failed, aborting' % rev + sys.exit(exc.returncode) + PERF="./hg --config extensions.perf=contrib/perf.py perfrevset" target_rev = sys.argv[1] @@ -49,7 +57,7 @@ check_call('hg log -r %s --template "{desc|firstline}\n"' % r, shell=True) print "----------------------------" - check_call(HG + ' ' + r, shell=True) + update(r) for idx, rset in enumerate(revsets): sys.stdout.write("%i) " % idx) sys.stdout.flush()