tests/helpers-testrepo.sh
changeset 33116 6c113a7dec52
parent 29219 3c9066ed557c
child 33125 acfce52518c4
equal deleted inserted replaced
33115:fa9a90d5ad89 33116:6c113a7dec52
     1 # The test-repo is a live hg repository which may have evolution
     1 # Invoke the system hg installation (rather than the local hg version being
     2 # markers created, e.g. when a ~/.hgrc enabled evolution.
     2 # tested).
     3 #
     3 #
     4 # Tests are run using a custom HGRCPATH, which do not
     4 # We want to use the hg version being tested when interacting with the test
     5 # enable evolution markers by default.
     5 # repository, and the system hg when interacting with the mercurial source code
       
     6 # repository.
     6 #
     7 #
     7 # If test-repo includes evolution markers, and we do not
     8 # The mercurial source repository was typically orignally cloned with the
     8 # enable evolution markers, hg will occasionally complain
     9 # system mercurial installation, and may require extensions or settings from
     9 # when it notices them, which disrupts tests resulting in
    10 # the system installation.
    10 # sporadic failures.
    11 syshg () {
    11 #
    12     (
    12 # Since we aren't performing any write operations on the
    13         syshgenv
    13 # test-repo, there's no harm in telling hg that we support
    14         exec hg "$@"
    14 # evolution markers, which is what the following lines
    15     )
    15 # for the hgrc file do:
    16 }
    16 cat >> $HGRCPATH << EOF
    17 
    17 [experimental]
    18 # Revert the environment so that running "hg" runs the system hg
    18 evolution=createmarkers
    19 # rather than the test hg installation.
    19 EOF
    20 syshgenv () {
       
    21     PATH="$ORIG_PATH"
       
    22     PYTHONPATH="$ORIG_PYTHONPATH"
       
    23     JYTHONPATH="$ORIG_JYTHONPATH"
       
    24     unset HGRCPATH
       
    25     HGPLAIN=1
       
    26     export HGPLAIN
       
    27 }