DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (7a6e0e07dc8f)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
#!/bin/bash

set +e
# Quick and dirty check for SSL support provided with this Python.  We check
# this way because some distros have backported the necessary SSL support
# into early Python versions, and we can't tell if we have what we need from
# the Python version alone.
python -c 'import ssl; ssl.SSLContext; ssl.PROTOCOL_TLSv1_2'
sslcheck=$?
set -e

if [ "$sslcheck" -ne 0 ]; then
  echo "Python version does not support verifying SSL certificates for secure"
  echo "downloads!  Please upgrade your version of Python."
  exit 1
fi

ROOT=`pwd`

for PYTHON_VERSION_NUMBER in 2 3
do
    echo "Installing virtualenv for Python ${PYTHON_VERSION_NUMBER}"

    # Set environment variables according to Python version being installed
    if [[ ${PYTHON_VERSION_NUMBER} -eq 2 ]]
    then
        VENV=${ROOT}/venv
        PYTHON_VERSION=python2.7
    else
        VENV=${ROOT}/venv/py3
        PYTHON_VERSION=python3
    fi

    if [ ! -d ${VENV}/lib ]; then
      # There is a bug in pycrypto where it tries to invoke `configure` instead
      # of a path qualified configure. So if there is a "configure" on $PATH
      # it will invoke the wrong one.
      configure=which configure &>/dev/null || true
      if [ "x" != "x${configure}" ]; then
        echo "configure in PATH; pycrypto install will fail!"
        echo "Remove the path containing ${configure} from PATH"
        exit 1
      fi

      . ${ROOT}/testing/create-virtualenv
    fi

    cd ${ROOT}
    source ${VENV}/bin/activate

    # Install different test requirements into each venv
    if [[ ${PYTHON_VERSION_NUMBER} -eq 2 ]]
    then
        pip install --upgrade --require-hashes -r test-requirements.txt
    else
        HGPYTHON3=1 pip install --upgrade --require-hashes -r test-requirements-3.txt
    fi


    cd hgserver/hgmolib
    python setup.py develop
    cd ../..

    cd pylib/Bugsy
    python setup.py develop
    cd ../..

    cd pylib/mozansible
    python setup.py develop
    cd ../..

    cd pylib/mozhg
    python setup.py develop
    cd ../..

    cd pylib/mozhginfo
    python setup.py develop
    cd ../..

    cd pylib/mozautomation
    python setup.py develop
    cd ../..

    cd pylib/vcsreplicator
    python setup.py develop
    cd ../..

    cd hghooks
    python setup.py develop
    cd ..

    cd testing
    python setup.py develop
    cd ..

done


python -m vcttesting.environment install-mercurials

# Set venv back to Python 2 for test runner code
VENV=${ROOT}/venv
source ${VENV}/bin/activate


python -m vcttesting.environment install-mercurials

if [ ! -d venv/git-cinnabar ]; then
  echo "Cloning git-cinnabar"
  git clone --branch release https://github.com/glandium/git-cinnabar.git venv/git-cinnabar
fi

cd venv/git-cinnabar
git pull
git submodule update --init
make -j4 helper NO_OPENSSL=1 NO_GETTEXT=1
cd ../..

if [ -z "${NO_DOCKER}" ]; then
  echo ""
  echo "Building Docker images."
  echo "This could take a while and may consume a lot of internet bandwidth."
  echo "If you don't want Docker images, it is safe to hit CTRL+c to abort this."

  ./d0cker build-all || {
    echo "You will not be able to run tests that require Docker.";
    echo "Please see https://docs.docker.com/installation/ for how to install Docker.";
    echo "When Docker is installed, re-run this script";
    exit 1
  }
else
  echo "Not building Docker images because NO_DOCKER is set."
fi

echo finished creating test environment!