mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +03:00
50e07b913e
Previously, if the system hg does not work, `helper-testrepo.sh` will skip the test (usually `test-check-*.t`). This patch makes it stricter so a non-functional system hg will be an error so it's less likely to be ignored. Differential Revision: https://phab.mercurial-scm.org/D387
36 lines
844 B
Bash
36 lines
844 B
Bash
source "$RUNTESTDIR/helpers-testrepo.sh"
|
|
|
|
# some version of helpers-testrepo.sh does not do this, but we want it to
|
|
# remove the obsstore warning. so let's check HGRCPATH and do it again.
|
|
if grep -q createmarkers "$HGRCPATH"; then
|
|
:
|
|
else
|
|
cat >> "$HGRCPATH" << EOF
|
|
[experimental]
|
|
evolution = createmarkers
|
|
EOF
|
|
fi
|
|
|
|
# go to repo root
|
|
cd "$TESTDIR"/..
|
|
|
|
# enable lz4revlog if it's required
|
|
if grep -q 'lz4revlog' .hg/requires; then
|
|
cat >> "$HGRCPATH" <<EOF
|
|
[extensions]
|
|
lz4revlog=
|
|
EOF
|
|
fi
|
|
|
|
# sanity check whether hg actually works or not
|
|
if ! hg log -r tip -T '{author}' >/dev/null 2>"$TESTTMP/hg-err-check"; then
|
|
echo 'hg does not work'
|
|
exit 1
|
|
fi
|
|
|
|
# hg might work but print "failed to ..." - treat that as an error
|
|
if [ -s "$TESTTMP/hg-err-check" ]; then
|
|
echo 'hg outputs to stderr: ' `cat "$TESTTMP/hg-err-check"`
|
|
exit 1
|
|
fi
|