##// END OF EJS Templates
phases: avoid N² behavior in `advanceboundary`...
phases: avoid N² behavior in `advanceboundary` We allowed duplicated entries in the deque, which each entry could potentially insert all its ancestors. So advancing boundary for the full repository would mean each revision would walk all its ancestors, resulting in O(N²) iteration. For repository of any decent size, N² is quickly insane. We introduce a simple set to avoid this and get back to reasonable performance.

File last commit:

r52200:87bfd170 default
r52398:c9ceb4f6 6.7 stable
Show More
recipe.sh
28 lines | 857 B | application/x-sh | BashLexer
#!/usr/bin/env bash
# find repo-root without calling hg as this might be run with sudo
THIS="$(readlink -m "$0")"
HERE="$(dirname "$THIS")"
HG_ROOT="$(readlink -m "$HERE"/../../..)"
echo source mercurial repository: "$HG_ROOT"
# find actual user as this might be run with sudo
if [ -n "$SUDO_UID" ]; then
ACTUAL_UID="$SUDO_UID"
else
ACTUAL_UID="$(id -u)"
fi
if [ -n "$SUDO_GID" ]; then
ACTUAL_GID="$SUDO_GID"
else
ACTUAL_GID="$(id -g)"
fi
echo using user "$ACTUAL_UID:$ACTUAL_GID"
if groups | egrep -q '\<(docker|root)\>' ; then
env DOCKER_BUILDKIT=1 docker build --tag mercurial-pytype-checker "$HERE"
docker run --rm -it --user "$ACTUAL_UID:$ACTUAL_GID" -v "$HG_ROOT:/tmp/mercurial-ci" mercurial-pytype-checker
else
echo "user not in the docker group" >&2
echo "(consider running this with \`sudo\`)" >&2
exit 255
fi