Commit Graph

7 Commits

Author SHA1 Message Date
Yuya Nishihara
60d0303672 tests: use system hg only if changelog or dirstate can't be read
The bundled hg should work flawlessly in most cases. Make it depend on
the external installation only if necessary since we can't control the
whole environment.

This patch doesn't implement the "exit 80" idea proposed by Jun. I don't
want to keep the capability checking sync with the actual tests.
2017-07-02 13:24:23 +09:00
Yuya Nishihara
7fd38829a4 tests: restore workaround of obsolete warning from 64c2b52740b5
It's simple and works well unless you are using third-party extensions
that changes the store format.
2017-07-02 13:20:28 +09:00
Yuya Nishihara
8f3fa790c1 tests: alias syshg and syshgenv so they can be switched conditionally 2017-07-02 13:14:20 +09:00
Adam Simpkins
738cc44d4e tests: more completely restore the environment in syshgenv
Update the syshgenv function to attempt to completely restore the original
environment, rather than only updating a few specific variables.  run_tests.py
now generates a shell script that can be used to restore the original
environment, and syshgenv sources it.

This is a bit more complicated than the previous code, but should do a better
job of running the system hg in the correct environment.

I've tested it on Linux using python 2.x, but let me know if it causes issues
in other environments.  I'm not terribly familiar with how the tests get run on
Windows, for instance, and how the environment needs to be updated there.
2017-06-28 12:23:22 -07:00
Jun Wu
4418dcadb3 tests: do not use system hg if it does not have "files" command
Ancient hg does not have "hg files" so test-check-*.t will fail with
"unknown command 'files'":

  $ hg files
  hg: unknown command 'files'
  $ hg --version
  Mercurial Distributed SCM (version 2.6.2)

Test "hg files" and give up using syshg if it does not have "files" command.
2017-06-28 13:45:51 -07:00
Adam Simpkins
55a457de69 tests: use the system hg for examining the local repository
Most test scripts use "hg" to interact with a temporary test repository.
However a few tests also want to run hg commands to interact with the local
repository containing the mercurial source code.  Notably, many of the
test-check-* tests want to check local files and commit messages.

These tests were previously using the version of hg being tested to query the
source repository.  However, this will fail if the source repository requires
extensions or other settings not supported by the version of mercurial being
tested.  The source repository was typically initially cloned using the system
hg installation, so we should use the system hg installation to query it.

There was already a helpers-testrepo.sh script designed to help cope with
different requirements for the source repository versus the test repositories.
However, it only handled the evolve extension.  This new behavior works with
any extensions that are different between the system installation and the test
installation.
2017-06-27 17:24:31 -07:00
timeless
0c82fc02cd tests: silence test-repo obsolete warning
refactoring test-check-commit.t HGRCPATH bits as helpers-testrepo.sh
2016-05-11 04:49:27 +00:00