##// END OF EJS Templates
tests: quote variable passed to shell test command
Yuya Nishihara -
r37493:152f1b47 default
parent child Browse files
Show More
@@ -1,60 +1,60 b''
1 # In most cases, the mercurial repository can be read by the bundled hg, but
1 # In most cases, the mercurial repository can be read by the bundled hg, but
2 # that isn't always true because third-party extensions may change the store
2 # that isn't always true because third-party extensions may change the store
3 # format, for example. In which case, the system hg installation is used.
3 # format, for example. In which case, the system hg installation is used.
4 #
4 #
5 # We want to use the hg version being tested when interacting with the test
5 # We want to use the hg version being tested when interacting with the test
6 # repository, and the system hg when interacting with the mercurial source code
6 # repository, and the system hg when interacting with the mercurial source code
7 # repository.
7 # repository.
8 #
8 #
9 # The mercurial source repository was typically orignally cloned with the
9 # The mercurial source repository was typically orignally cloned with the
10 # system mercurial installation, and may require extensions or settings from
10 # system mercurial installation, and may require extensions or settings from
11 # the system installation.
11 # the system installation.
12
12
13 if [ -n $HGTESTEXTRAEXTENSIONS ]; then
13 if [ -n "$HGTESTEXTRAEXTENSIONS" ]; then
14 for extension in $HGTESTEXTRAEXTENSIONS; do
14 for extension in $HGTESTEXTRAEXTENSIONS; do
15 extraoptions="$extraoptions --config extensions.$extension=!"
15 extraoptions="$extraoptions --config extensions.$extension=!"
16 done
16 done
17 fi
17 fi
18
18
19 syshg () {
19 syshg () {
20 (
20 (
21 syshgenv
21 syshgenv
22 exec hg "$@"
22 exec hg "$@"
23 )
23 )
24 }
24 }
25
25
26 # Revert the environment so that running "hg" runs the system hg
26 # Revert the environment so that running "hg" runs the system hg
27 # rather than the test hg installation.
27 # rather than the test hg installation.
28 syshgenv () {
28 syshgenv () {
29 . "$HGTEST_RESTOREENV"
29 . "$HGTEST_RESTOREENV"
30 HGPLAIN=1
30 HGPLAIN=1
31 export HGPLAIN
31 export HGPLAIN
32 }
32 }
33
33
34 # The test-repo is a live hg repository which may have evolution markers
34 # The test-repo is a live hg repository which may have evolution markers
35 # created, e.g. when a ~/.hgrc enabled evolution.
35 # created, e.g. when a ~/.hgrc enabled evolution.
36 #
36 #
37 # Tests may be run using a custom HGRCPATH, which do not enable evolution
37 # Tests may be run using a custom HGRCPATH, which do not enable evolution
38 # markers by default.
38 # markers by default.
39 #
39 #
40 # If test-repo includes evolution markers, and we do not enable evolution
40 # If test-repo includes evolution markers, and we do not enable evolution
41 # markers, hg will occasionally complain when it notices them, which disrupts
41 # markers, hg will occasionally complain when it notices them, which disrupts
42 # tests resulting in sporadic failures.
42 # tests resulting in sporadic failures.
43 #
43 #
44 # Since we aren't performing any write operations on the test-repo, there's
44 # Since we aren't performing any write operations on the test-repo, there's
45 # no harm in telling hg that we support evolution markers, which is what the
45 # no harm in telling hg that we support evolution markers, which is what the
46 # following lines for the hgrc file do:
46 # following lines for the hgrc file do:
47 cat >> "$HGRCPATH" << EOF
47 cat >> "$HGRCPATH" << EOF
48 [experimental]
48 [experimental]
49 evolution = createmarkers
49 evolution = createmarkers
50 EOF
50 EOF
51
51
52 # Use the system hg command if the bundled hg can't read the repository with
52 # Use the system hg command if the bundled hg can't read the repository with
53 # no warning nor error.
53 # no warning nor error.
54 if [ -n "`hg id -R "$TESTDIR/.." 2>&1 >/dev/null`" ]; then
54 if [ -n "`hg id -R "$TESTDIR/.." 2>&1 >/dev/null`" ]; then
55 alias testrepohg=syshg
55 alias testrepohg=syshg
56 alias testrepohgenv=syshgenv
56 alias testrepohgenv=syshgenv
57 else
57 else
58 alias testrepohg="hg $extraoptions"
58 alias testrepohg="hg $extraoptions"
59 alias testrepohgenv=:
59 alias testrepohgenv=:
60 fi
60 fi
General Comments 0
You need to be logged in to leave comments. Login now