--- a/bench.py Thu May 26 00:09:38 2016 +0800
+++ b/bench.py Mon Jul 04 17:52:42 2016 +0800
from argparse import ArgumentParser
from collections import OrderedDict
+from subprocess import check_output, CalledProcessError, STDOUT
from settings import DBPATH, HG, LOCKFILE, TESTHGREPO, TESTREPO, rel
shutil.rmtree(rel(TESTREPO, '.hg', 'cache'), ignore_errors=True)
- subprocess.check_output(cmd)
- except subprocess.CalledProcessError:
+ except CalledProcessError:
results.append(time.time() - start)
cmd = [HG, 'log', '-R', TESTHGREPO, '-T', '{node}\n']
- output = subprocess.check_output(cmd)
+ output = check_output(cmd)
""" Pick one continuous span of nodes that still need testing. """
cmd = [HG, 'log', '-R', TESTHGREPO, '-T', '{node}\n', '-r', 'sort(all(), rev)']
- output = subprocess.check_output(cmd)
+ output = check_output(cmd)
def guessspikes(maxrevs):
cmd = [HG, 'log', '-R', TESTHGREPO, '-T', '{node}\n', '-r', 'sort(all(), -rev)']
- output = subprocess.check_output(cmd)
+ output = check_output(cmd)
conn = sqlite3.connect(DBPATH)
- subprocess.check_output(['make', '--directory', TESTHGREPO, 'clean'], stderr=subprocess.STDOUT)
+ check_output(['make', '--directory', TESTHGREPO, 'clean'], stderr=STDOUT)
- subprocess.check_output([HG, 'update', '-R', TESTHGREPO, '--clean', node], stderr=subprocess.STDOUT)
- subprocess.check_output(['make', '--directory', TESTHGREPO, 'local'], stderr=subprocess.STDOUT)
+ check_output([HG, 'update', '-R', TESTHGREPO, '--clean', node], stderr=STDOUT)
+ check_output(['make', '--directory', TESTHGREPO, 'local'], stderr=STDOUT)