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

script: add a scrip to make all reference repositories

This script creates all necessary reference in a single run
parent 8b4aa34e
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
set -euo pipefail
if [ $# -lt 3 ]; then
echo 'usage: make-all HGVERSION SOURCE ID'
exit 64
fi
root="`dirname $0`"
hg_version="$1"
repo_source="$2"
repo_id="$3"
venv_path=/tmp/build-reference-${repo_id}-venv
rm -rf $venv_path
virtualenv $venv_path
${venv_path}/bin/pip --quiet install "mercurial==${hg_version}"
export HGRCPATH=
alias python="${venv_path}/bin/python"
python -c "import yaml"
"${root}"/make-reference "${repo_source}" "${repo_id}"
"${root}"/make-partial-repos "${root}"/../partial-sets.yaml "${repo_id}".benchrepo
===================================================
test the "all in one" make-all that build reference
===================================================
Setup
(locally cache wheel)
$ mkdir -p /tmp/.scm-perf-test/pip-cache
$ export XDG_CACHE_HOME=/tmp/.scm-perf-test/pip-cache
$ export PATH=$TESTDIR/../repo-scripts/:${PATH}
$ mkdir some-dir
$ hg init some-dir/my-source-repo
$ hg -R some-dir/my-source-repo debugbuilddag --new-file '.+5:brancha$.+11:branchb$.+30:branchc<brancha+2<branchb+2'
Wrong call
----------
$ make-all
usage: make-all HGVERSION SOURCE ID
[64]
Good call
---------
$ make-all 4.7 some-dir/my-source-repo testrepo
New python executable in /tmp/build-reference-testrepo-venv/bin/python
Installing setuptools, pip, wheel...done.
hg cloning repository from: some-dir/my-source-repo
building a reference tarball
result available at: testrepo-reference.tar
Cloning testrepo (testrepo-reference stripped of last(all(), 100)) into ./testrepo-partial-last-hundred (for exchange benchmarks)
Cloning testrepo (testrepo-reference stripped of last(all(), 10)) into ./testrepo-partial-last-ten (for exchange benchmarks)
Cloning testrepo (testrepo-reference stripped of last(all(), 1000)) into ./testrepo-partial-last-thousand (for exchange benchmarks)
Cloning testrepo (testrepo-reference stripped of None) into ./testrepo-partial-same (for exchange benchmarks)
$ ls -1 *.tar
testrepo-partial-last-hundred.tar
testrepo-partial-last-ten.tar
testrepo-partial-last-thousand.tar
testrepo-partial-same.tar
testrepo-reference.tar
$ tar -axf testrepo-reference.tar testrepo.benchrepo -O
reference-repo:
id: testrepo
enabled: Yes
source: some-dir/my-source-repo
hg-version: 4.7+27-25eb8dcdb44d
number-revisions:
visible: 53
all: 53
number-heads:
visible: 3
all: 3
number-names-branch:
visible: 1
all: 1
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