view tests/testlib/update-hg-repo.sh @ 6935:954d7ea5cd67 stable tip

stack: when stack base is obsolete, pick any successor, even if at random There are situations when s0 is obsolete and we also cannot pick just one successor for it to use in stack. In such a case, let's pick the "latest" successor from the first set. We're assuming that obsutil.successorssets() returns data in the same order (it should, since it makes sure to sort data internally). Keeping that in mind, while the successor picked for s0 by this code is not based on any sort of sophisticated logic, it should nonetheless be the same every time. This patch is probably not going to completely break anything that was previously working fine, because the previous behavior was to just abort with an exception.
author Anton Shestakov <av6@dwimlabs.net>
date Sat, 16 Nov 2024 17:01:02 +0400
parents fc3ad54219d7
children
line wrap: on
line source

#!/bin/sh
# Clone or update core Mercurial repo at the provided path. Useful for CI
# runners that don't have a shared repo setup, e.g. the shell runner that is
# currently used for Windows CI.

URL=https://mirror.octobus.net/hg
if hg root -R "$1"; then
    hg pull -R "$1" "$URL"
else
    rm -rf "$1"
    hg clone "$URL" "$1"
fi