From f80ded6c422d9b1499dd4a526ac9f154dfd49f68 Mon Sep 17 00:00:00 2001 From: xavierzwirtz Date: Mon, 22 Jul 2019 20:09:56 -0500 Subject: [PATCH 1/2] Enabled evolve Signed-off-by: xavierzwirtz --- hgrc | 3 +++ test/test_in.sh | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/hgrc b/hgrc index d2d45ca..0d3599f 100644 --- a/hgrc +++ b/hgrc @@ -3,3 +3,6 @@ username = User Name [phases] publish = false + +[extensions] +evolve = \ No newline at end of file diff --git a/test/test_in.sh b/test/test_in.sh index d62bbe4..725cc70 100755 --- a/test/test_in.sh +++ b/test/test_in.sh @@ -162,4 +162,33 @@ test_it_can_get_with_ssl_cert_checks_disabled() { sleep 0.1 } +test_it_ignores_obsolete() { + local repo=$(init_repo) + local ref1=$(make_commit $repo) + local ref2=$(make_commit $repo) + + local dest=$TMPDIR/destination + + local expected1=$(echo "{\"ref\": $(echo $ref2 | jq -R .)}" | jq ".") + assertEquals "$expected1" "$(get_uri $repo $dest | jq '.version')" + + if [ ! -e "$dest/some-file" ]; then + fail "expected some-file to exist in the working directory" + fi + assertEquals "$ref2" "$(get_working_dir_ref $dest)" + + rm -rf $dest + + # prune $ref2 and verify that concourse sees $ref1 as the tip + hg prune --cwd $repo $ref2 + + local expected2=$(echo "{\"ref\": $(echo $ref1 | jq -R .)}" | jq ".") + assertEquals "$expected2" "$(get_uri $repo $dest | jq '.version')" + + if [ ! -e "$dest/some-file" ]; then + fail "expected some-file to exist in the working directory" + fi + assertEquals "$ref1" "$(get_working_dir_ref $dest)" +} + source $(dirname $0)/shunit2 From 412a7661263d3288498b2af9f1fabd7f761e0c10 Mon Sep 17 00:00:00 2001 From: xavierzwirtz Date: Mon, 22 Jul 2019 20:10:32 -0500 Subject: [PATCH 2/2] Switched to installing mercurial from pip, added evolve install Signed-off-by: xavierzwirtz --- dockerfiles/alpine/Dockerfile | 9 ++++++++- dockerfiles/ubuntu/Dockerfile | 12 ++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/dockerfiles/alpine/Dockerfile b/dockerfiles/alpine/Dockerfile index ab67201..b074e10 100644 --- a/dockerfiles/alpine/Dockerfile +++ b/dockerfiles/alpine/Dockerfile @@ -17,7 +17,14 @@ RUN apk add --update \ jq \ openssh \ tar \ - mercurial + python2 \ + python2-dev \ + py2-pip \ + build-base + +RUN pip2 install mercurial +RUN pip2 install hg-evolve + COPY --from=builder /assets /opt/resource ADD assets/askpass.sh /opt/resource RUN chmod +x /opt/resource/* diff --git a/dockerfiles/ubuntu/Dockerfile b/dockerfiles/ubuntu/Dockerfile index 588e943..ce061b4 100644 --- a/dockerfiles/ubuntu/Dockerfile +++ b/dockerfiles/ubuntu/Dockerfile @@ -15,8 +15,16 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ gnupg \ jq \ openssh-client \ - mercurial \ - && rm -rf /var/lib/apt/lists/* + python \ + python-pip \ + build-essential \ + python-all-dev \ + python-setuptools \ + python-wheel \ + && rm -rf /var/lib/apt/lists/* \ + && pip2 install mercurial \ + && pip2 install hg-evolve + COPY --from=builder /assets /opt/resource ADD assets/askpass.sh /opt/resource RUN chmod +x /opt/resource/*