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