##// END OF EJS Templates
tests: make check-py3-compat.py actually load the specified files correctly...
tests: make check-py3-compat.py actually load the specified files correctly For most uses, this change is essentially a no-op, as this script is generally only run by test-check-py3-compat.t, which will already put `$TESTDIR/..` in `$PYTHONPATH`. When running outside of tests, however, `$PYTHONPATH` is likely not set, causing check-py3-compat.py to parse the file from the repo, but then import the installed version, and raise any errors about the installed version, not the one currently in the repo. Additionally, this helps users (like me) who have a strange set up where their home directory (and thus their hg repos) happen to be in a subdirectory of sys.prefix (which is /usr on my system). Since the '.' entry added to sys.path takes precedence over the absolute path of `$TESTDIR/..` in `$PYTHONPATH`, the path to the modules that it imports (and that show up in any stack trace) are *relative*, meaning that we don't detect them as starting with `sys.prefix`. Sample non-test invocation, and the difference this change makes (the path for 'error at <path>:<line>' is correct now):: Before: ``` $ python3 contrib/check-py3-compat.py mercurial/win*.py mercurial/win32.py: error importing: <ValueError> _type_ 'v' not supported (error at check-py3-compat.py:65) mercurial/windows.py: error importing: <ModuleNotFoundError> No module named 'msvcrt' (error at check-py3-compat.py:65) ``` After: ``` $ python3 contrib/check-py3-compat.py mercurial/win*.py mercurial/win32.py: error importing: <ValueError> _type_ 'v' not supported (error at win32.py:11) mercurial/windows.py: error importing: <ModuleNotFoundError> No module named 'msvcrt' (error at windows.py:12) ``` Differential Revision: https://phab.mercurial-scm.org/D8814
Kyle Lippincott -
r45776:4e5da64d default
Show More
Name Size Modified Last Commit Author
contrib
doc
hgdemandimport
hgext
hgext3rd
i18n
mercurial
relnotes
rust
tests
.arcconfig Loading ...
.clang-format Loading ...
.editorconfig Loading ...
.hgignore Loading ...
.hgsigs Loading ...
.hgtags Loading ...
.jshintrc Loading ...
CONTRIBUTING Loading ...
CONTRIBUTORS Loading ...
COPYING Loading ...
Makefile Loading ...
README.rst Loading ...
black.toml Loading ...
hg Loading ...
hgeditor Loading ...
hgweb.cgi Loading ...
setup.py Loading ...

Mercurial

Mercurial is a fast, easy to use, distributed revision control tool for software developers.

Basic install:

$ make            # see install targets
$ make install    # do a system-wide install
$ hg debuginstall # sanity-check setup
$ hg              # see help

Running without installing:

$ make local      # build for inplace usage
$ ./hg --version  # should show the latest version

See https://mercurial-scm.org/ for detailed installation instructions, platform-specific notes, and Mercurial user information.