test-run-tests: stabilize the test (
issue5735)
Previously there is a race condition because things happen in this order:
1. Check shouldStop
2. If shouldStop is false, print the diff
3. Call fail() -> set shouldStop
The check and set should really happen in a same critical section.
This patch adds a lock to address the issue.
Test Plan:
Run `run-tests.py -l test-run-tests.t` 20 times on gcc112 and the race
condition does not reproduce.
Differential Revision: https://phab.mercurial-scm.org/D1830
run-tests: avoid set PYTHONUSERBASE environment variable to None
According to python documentation, get_config_var can return None and it was
during running mercurial tests under a virtual environment with the local built
mercurial installed as a python package with `pip install -e .`.
On the other hand, if mercurial is installed in the user library folders with
`pip install --local -e .` the issue doesn't reproduce.
The fallback is that it will just set an empty string and everything should work
as before, according to https://www.python.org/dev/peps/pep-0370/:
The path to the user base directory can be overwritten with the environment
variable PYTHONUSERBASE. The default location is used when PYTHONUSERBASE is
not set or empty.
templatefilters: fix doc of basename()
os.path.basename() does NOT strip trailing slashes.
> Note that the result of this function is different from the Unix basename
> program; where basename for '/foo/bar/' returns 'bar', the basename()
> function returns an empty string ('').
https://docs.python.org/2.7/library/os.path.html#os.path.basename
identify: document -r. explicitly how to disable wdir scanning (
issue5622)
tests: make #testcase available as env var in test
It can be useful for e.g. helper functions to behave differently
depending on which test case is being executed. This patch helps with
that by making the #testcase case available as a TESTCASE environment
variable.
Differential Revision: https://phab.mercurial-scm.org/D1816
archive: add support to specify hidden revs if directaccess config is set
Differential Revision: https://phab.mercurial-scm.org/D1812
annotate: add support to specify hidden revs if directaccess config is set
Differential Revision: https://phab.mercurial-scm.org/D1811