Skip to content
Snippets Groups Projects
Commit 45d6e276 authored by Yuya Nishihara's avatar Yuya Nishihara
Browse files

tests: use system hg only if changelog or dirstate can't be read

The bundled hg should work flawlessly in most cases. Make it depend on
the external installation only if necessary since we can't control the
whole environment.

This patch doesn't implement the "exit 80" idea proposed by Jun. I don't
want to keep the capability checking sync with the actual tests.
parent 2d7300cf
No related branches found
No related tags found
No related merge requests found
# Invoke the system hg installation (rather than the local hg version being # In most cases, the mercurial repository can be read by the bundled hg, but
# tested). # that isn't always true because third-party extensions may change the store
# format, for example. In which case, the system hg installation is used.
# #
# We want to use the hg version being tested when interacting with the test # We want to use the hg version being tested when interacting with the test
# repository, and the system hg when interacting with the mercurial source code # repository, and the system hg when interacting with the mercurial source code
...@@ -41,11 +42,9 @@ ...@@ -41,11 +42,9 @@
evolution = createmarkers evolution = createmarkers
EOF EOF
# Most test-check-* sourcing this file run "hg files", which is not available # Use the system hg command if the bundled hg can't read the repository with
# in ancient versions of hg. So we double check if "syshg files" works and # no warning nor error.
# fallback to hg bundled in the repo. if [ -n "`hg id -R "$TESTDIR/.." 2>&1 >/dev/null`" ]; then
syshg files -h >/dev/null 2>/dev/null
if [ $? -eq 0 ]; then
alias testrepohg=syshg alias testrepohg=syshg
alias testrepohgenv=syshgenv alias testrepohgenv=syshgenv
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment