Mercurial > hg
comparison contrib/benchmarks/__init__.py @ 30559:d83ca854fa21
ui: factor out ui.load() to create a ui without loading configs (API)
This allows us to write doctests depending on a ui object, but not on global
configs.
ui.load() is a class method so we can do wsgiui.load(). All ui() calls but
for doctests are replaced with ui.load(). Some of them could be changed to
not load configs later.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 22 Oct 2016 14:35:10 +0900 |
parents | cff0f5926797 |
children | be0e7af80543 |
comparison
equal
deleted
inserted
replaced
30557:cbeb54ec0481 | 30559:d83ca854fa21 |
---|---|
48 outputre = re.compile((r'! wall (\d+.\d+) comb \d+.\d+ user \d+.\d+ sys ' | 48 outputre = re.compile((r'! wall (\d+.\d+) comb \d+.\d+ user \d+.\d+ sys ' |
49 r'\d+.\d+ \(best of \d+\)')) | 49 r'\d+.\d+ \(best of \d+\)')) |
50 | 50 |
51 def runperfcommand(reponame, command, *args, **kwargs): | 51 def runperfcommand(reponame, command, *args, **kwargs): |
52 os.environ["HGRCPATH"] = os.environ.get("ASVHGRCPATH", "") | 52 os.environ["HGRCPATH"] = os.environ.get("ASVHGRCPATH", "") |
53 ui = uimod.ui() | 53 ui = uimod.ui.load() |
54 repo = hg.repository(ui, os.path.join(reposdir, reponame)) | 54 repo = hg.repository(ui, os.path.join(reposdir, reponame)) |
55 perfext = extensions.load(ui, 'perfext', | 55 perfext = extensions.load(ui, 'perfext', |
56 os.path.join(basedir, 'contrib', 'perf.py')) | 56 os.path.join(basedir, 'contrib', 'perf.py')) |
57 cmd = getattr(perfext, command) | 57 cmd = getattr(perfext, command) |
58 ui.pushbuffer() | 58 ui.pushbuffer() |