mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 01:07:15 +03:00
0dab1ab662
Summary: All of the test-check*.t tests cd out of the test repository and into the main normal fb-hgext repository, and attempt to run hg commands there to examine the repository contents. Unfortunately they were doing so still using the HGRCPATH settings configured for the test repository. In practice this causes the tests in many situations, because extensions enabled in the system configuration and required for the main repository may not have been enabled. Test Plan: Ran "arc unit" in a repository with sqldirstate enabled and confirmed the tests pass now instead of bombing out with screenfuls of error messages. Reviewers: #sourcecontrol, stash, durham, rmcelroy Reviewed By: rmcelroy Subscribers: rmcelroy, net-systems-diffs@, yogeshwer, mjpieters Differential Revision: https://phabricator.intern.facebook.com/D4427670 Signature: t1:4427670:1484733701:f6c859c29d34eb33b1280e798ab3398a03a3a461
36 lines
1.1 KiB
Perl
36 lines
1.1 KiB
Perl
#require test-repo
|
|
|
|
Skip the test if check-commit is unavailable. It happens if we only have
|
|
run-tests.py but do not have the core hg repo.
|
|
|
|
$ . $TESTDIR/require-core-hg.sh contrib/check-commit
|
|
|
|
This file is backported from mercurial/tests/test-check-commit.t.
|
|
It differs slightly to fix paths and prevent bypassing.
|
|
|
|
Enable obsolescence to avoid the warning issue when obsmarker are found
|
|
|
|
$ . "$RUNTESTDIR/helpers-testrepo.sh"
|
|
|
|
Go back in the current repo (fb-hgext)
|
|
|
|
$ cd $TESTDIR/..
|
|
$ unset BYPASS
|
|
|
|
Clear the test HGRCPATH setting, to use the normal hg config path. Trying
|
|
to run hg commands in the normal repository probably will not work without
|
|
the normal system hg configs.
|
|
|
|
$ unset HGRCPATH
|
|
|
|
$ for node in `hg log --rev 'not public() and ::.' --template '{node|short}\n'`; do
|
|
> hg export $node | $RUNTESTDIR/../contrib/check-commit > ${TESTTMP}/check-commit.out
|
|
> if [ $? -ne 0 ]; then
|
|
> echo "Revision $node does not comply with rules"
|
|
> echo '------------------------------------------------------'
|
|
> cat ${TESTTMP}/check-commit.out
|
|
> echo
|
|
> fi
|
|
> done
|
|
|