Skip to content

Commit

Permalink
Merge pull request #12 from xavierzwirtz/evolve
Browse files Browse the repository at this point in the history
Enable 'evolve'
  • Loading branch information
vito authored Aug 13, 2019
2 parents dbe2fb8 + 146b8c2 commit 9cdc625
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 3 deletions.
9 changes: 8 additions & 1 deletion dockerfiles/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
Expand Down
12 changes: 10 additions & 2 deletions dockerfiles/ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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/*
Expand Down
3 changes: 3 additions & 0 deletions hgrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ username = User Name <[email protected]>

[phases]
publish = false

[extensions]
evolve =
29 changes: 29 additions & 0 deletions test/test_in.sh
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,35 @@ 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)"
}

test_path_changed() {
local repo1=$(init_repo)
local repo1_ref=$(make_commit $repo1)
Expand Down

0 comments on commit 9cdc625

Please sign in to comment.