Skip to content
Snippets Groups Projects
Commit 38a2d60d authored by Pierre-Yves David's avatar Pierre-Yves David :octopus:
Browse files

benchmark: add a 'has_command' method

parent f46c6b55
No related branches found
No related tags found
No related merge requests found
......@@ -498,6 +498,18 @@
def update_repo_cache(self):
self.hg('debugupdatecache')
def has_command(self, cmd):
"""return true if the command exist at the current version"""
try:
self.hg('--config', 'ui.strict=yes', 'help', '--command', cmd)
except subprocess.CalledProcessError as exc:
if exc.returncode != 255:
raise
# command does not exist in this version of mercurial
return False
return True
def _getperfext(self, version):
"""given a mercurial-core node (or None) return a path to perfext
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment