contrib/benchmarks/__init__.py
changeset 50928 d718eddf01d9
parent 48875 6000f5b25c9b
equal deleted inserted replaced
50927:7a8ea1397816 50928:d718eddf01d9
    38 
    38 
    39 from mercurial import (
    39 from mercurial import (
    40     extensions,
    40     extensions,
    41     hg,
    41     hg,
    42     ui as uimod,
    42     ui as uimod,
    43     util,
       
    44 )
    43 )
    45 
    44 
    46 basedir = os.path.abspath(
    45 basedir = os.path.abspath(
    47     os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir)
    46     os.path.join(os.path.dirname(__file__), os.path.pardir, os.path.pardir)
    48 )
    47 )
    64 
    63 
    65 def runperfcommand(reponame, command, *args, **kwargs):
    64 def runperfcommand(reponame, command, *args, **kwargs):
    66     os.environ["HGRCPATH"] = os.environ.get("ASVHGRCPATH", "")
    65     os.environ["HGRCPATH"] = os.environ.get("ASVHGRCPATH", "")
    67     # for "historical portability"
    66     # for "historical portability"
    68     # ui.load() has been available since d83ca85
    67     # ui.load() has been available since d83ca85
    69     if util.safehasattr(uimod.ui, "load"):
    68     if hasattr(uimod.ui, "load"):
    70         ui = uimod.ui.load()
    69         ui = uimod.ui.load()
    71     else:
    70     else:
    72         ui = uimod.ui()
    71         ui = uimod.ui()
    73     repo = hg.repository(ui, os.path.join(reposdir, reponame))
    72     repo = hg.repository(ui, os.path.join(reposdir, reponame))
    74     perfext = extensions.load(
    73     perfext = extensions.load(