# HG changeset patch # User Anton Shestakov # Date 1574320715 -25200 # Node ID 4f3c87584a4a56b52cf87f2139035577bfa7067e # Parent 4941bb6d179c8b208def5116e93e101509ebfc75 heptapod-ci: add a script to map evolve branch to mercurial revision for tests map-hg-rev.sh can be tested using this command: ```sh for i in $(hg log -T '{branch}\n' | sort -u); do echo $i $(testlib/map-hg-rev.sh $i) done ``` diff -r 4941bb6d179c -r 4f3c87584a4a .gitlab-ci.yml --- a/.gitlab-ci.yml Mon Nov 18 12:55:44 2019 +0100 +++ b/.gitlab-ci.yml Thu Nov 21 14:18:35 2019 +0700 @@ -7,26 +7,30 @@ image: octobus/ci-py2-hgext3rd script: - hg pull -R /ci/repos/mercurial/ - - hg -R /ci/repos/mercurial/ update `hg log -r . -T '{branch}'` + - hg_rev=$(tests/testlib/map-hg-rev.sh "$(hg log -r . -T '{branch}')") + - hg -R /ci/repos/mercurial/ update "$hg_rev" - (cd tests; /ci/repos/mercurial/tests/run-tests.py --color=always) tests-py2-pure: image: octobus/ci-py2-hgext3rd script: - hg pull -R /ci/repos/mercurial/ - - hg -R /ci/repos/mercurial/ update `hg log -r . -T '{branch}'` + - hg_rev=$(tests/testlib/map-hg-rev.sh "$(hg log -r . -T '{branch}')") + - hg -R /ci/repos/mercurial/ update "$hg_rev" - (cd tests; /ci/repos/mercurial/tests/run-tests.py --color=always --pure) tests-py3-cext: image: octobus/ci-py3-hgext3rd script: - hg pull -R /ci/repos/mercurial/ - - hg -R /ci/repos/mercurial/ update `hg log -r . -T '{branch}'` + - hg_rev=$(tests/testlib/map-hg-rev.sh "$(hg log -r . -T '{branch}')") + - hg -R /ci/repos/mercurial/ update "$hg_rev" - (cd tests; python3 /ci/repos/mercurial/tests/run-tests.py --color=always) tests-py3-pure: image: octobus/ci-py3-hgext3rd script: - hg pull -R /ci/repos/mercurial/ - - hg -R /ci/repos/mercurial/ update `hg log -r . -T '{branch}'` + - hg_rev=$(tests/testlib/map-hg-rev.sh "$(hg log -r . -T '{branch}')") + - hg -R /ci/repos/mercurial/ update "$hg_rev" - (cd tests; python3 /ci/repos/mercurial/tests/run-tests.py --color=always --pure) diff -r 4941bb6d179c -r 4f3c87584a4a tests/testlib/map-hg-rev.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/testlib/map-hg-rev.sh Thu Nov 21 14:18:35 2019 +0700 @@ -0,0 +1,15 @@ +#!/bin/sh +set -eu + +case $1 in + default) + echo default + ;; + mercurial-*) + exp=$(echo "$1" | cut -d- -f2 | sed 's#\.#\\.#g') + echo 'max(tag("re:^'"$exp"'"))' + ;; + *) + echo stable + ;; +esac