##// END OF EJS Templates
tests: do not use system hg if it does not have "files" command...
Jun Wu -
r33120:acfce525 default
parent child Browse files
Show More
@@ -1,27 +1,40 b''
1 # Invoke the system hg installation (rather than the local hg version being
1 # Invoke the system hg installation (rather than the local hg version being
2 # tested).
2 # tested).
3 #
3 #
4 # We want to use the hg version being tested when interacting with the test
4 # We want to use the hg version being tested when interacting with the test
5 # repository, and the system hg when interacting with the mercurial source code
5 # repository, and the system hg when interacting with the mercurial source code
6 # repository.
6 # repository.
7 #
7 #
8 # The mercurial source repository was typically orignally cloned with the
8 # The mercurial source repository was typically orignally cloned with the
9 # system mercurial installation, and may require extensions or settings from
9 # system mercurial installation, and may require extensions or settings from
10 # the system installation.
10 # the system installation.
11 syshg () {
11 syshg () {
12 (
12 (
13 syshgenv
13 syshgenv
14 exec hg "$@"
14 exec hg "$@"
15 )
15 )
16 }
16 }
17
17
18 # Revert the environment so that running "hg" runs the system hg
18 # Revert the environment so that running "hg" runs the system hg
19 # rather than the test hg installation.
19 # rather than the test hg installation.
20 syshgenv () {
20 syshgenv () {
21 PATH="$ORIG_PATH"
21 PATH="$ORIG_PATH"
22 PYTHONPATH="$ORIG_PYTHONPATH"
22 PYTHONPATH="$ORIG_PYTHONPATH"
23 JYTHONPATH="$ORIG_JYTHONPATH"
23 JYTHONPATH="$ORIG_JYTHONPATH"
24 unset HGRCPATH
24 unset HGRCPATH
25 HGPLAIN=1
25 HGPLAIN=1
26 export HGPLAIN
26 export HGPLAIN
27 }
27 }
28
29 # Most test-check-* sourcing this file run "hg files", which is not available
30 # in ancient versions of hg. So we double check if "syshg files" works and
31 # fallback to hg bundled in the repo.
32 syshg files -h >/dev/null 2>/dev/null
33 if [ $? -ne 0 ]; then
34 syshg() {
35 hg "$@"
36 }
37 syshgenv() {
38 :
39 }
40 fi
General Comments 0
You need to be logged in to leave comments. Login now