contrib/benchmarks/__init__.py
changeset 47458 50cd14dbd3b3
parent 47437 7a430116f639
child 48875 6000f5b25c9b
equal deleted inserted replaced
47457:f8330a3fc39f 47458:50cd14dbd3b3
    74     repo = hg.repository(ui, os.path.join(reposdir, reponame))
    74     repo = hg.repository(ui, os.path.join(reposdir, reponame))
    75     perfext = extensions.load(
    75     perfext = extensions.load(
    76         ui, 'perfext', os.path.join(basedir, 'contrib', 'perf.py')
    76         ui, 'perfext', os.path.join(basedir, 'contrib', 'perf.py')
    77     )
    77     )
    78     cmd = getattr(perfext, command)
    78     cmd = getattr(perfext, command)
    79     with ui.silent():
    79     ui.pushbuffer()
    80         cmd(ui, repo, *args, **kwargs)
    80     cmd(ui, repo, *args, **kwargs)
       
    81     output = ui.popbuffer()
    81     match = outputre.search(output)
    82     match = outputre.search(output)
    82     if not match:
    83     if not match:
    83         raise ValueError("Invalid output {}".format(output))
    84         raise ValueError("Invalid output {}".format(output))
    84     return float(match.group(1))
    85     return float(match.group(1))
    85 
    86