sapling/tests/helper-testrepo.sh
Kostia Balytskyi e75b9fc1b1 fb-hgext: move most of hgext3rd and related tests to core
Summary:
This commit moves most of the stuff in hgext3rd and related tests to
hg-crew/hgext and hg-crew/test respectively.

The things that are not moved are the ones which require some more complex
imports.


Depends on D6675309

Test Plan: - tests are failing at this commit, fixes are in the following commits

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D6675329
2018-01-09 03:03:59 -08:00

37 lines
852 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 ! testrepohg 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