Skip to content
Snippets Groups Projects
Commit 32bd08d8 authored by Boris Feld's avatar Boris Feld
Browse files

Use a script to clone all repositories

parent 44b32ff2
No related branches found
No related tags found
No related merge requests found
repos:
mercurial-2017:
url: https://www.mercurial-scm.org/repo/hg/
pypy-2017:
url: https://bitbucket.org/pypy/pypy/get/75bf1a9.zip
mozilla-central-2017:
url: https://hg.mozilla.org/mozilla-central
......@@ -8,9 +8,7 @@
python -m perf system show | grep "OK!"
# Ensure all repository are here
if [ ! -d "repos/mozilla-central/" ]; then
hg clone https://hg.mozilla.org/mozilla-central/ repos/mozilla-central/
fi
python prepate_repos.py
# Launch asv
taskset -c 2,3 asv run --show-stderr --skip-existing-successful --steps 10 "NEW"
......
""" Ensure that all repository are cloned and at their tip
"""
import hglib
from os.path import isdir, join
import yaml
def read_configuration(config_path):
with open(config_path) as config_file:
return yaml.load(config_file.read())
def check_repositories(config, repos_dir):
to_clone = []
for repo_name, repo in config['repos'].items():
if not isdir(join(repos_dir, repo_name)):
to_clone.append((repo_name, repo))
return to_clone
def clone_repositories(repositories, repos_dir):
for repo_name, repo in repositories:
print("Cloning %s (%s) into %s" % (repo_name, repo['url'], join(repos_dir, repo_name)))
hglib.clone(repo['url'], join(repos_dir, repo_name))
config = read_configuration("config.yaml")
to_clone = check_repositories(config, "repos")
clone_repositories(to_clone, "repos")
python-hglib
virtualenv
git+https://github.com/Lothiraldan/asv.git#egg=asv
pyyaml
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