- Nov 05, 2019
-
-
Gregory Szorc authored
Debian's python install has a crippled venv by default, as it is lacking ensurepip. When you try to run `python3 -m venv` it tells you to install `python3-venv`. So this commit does that in our automation environment so we can fully test installing Mercurial using venv+pip with the system Python. Differential Revision: https://phab.mercurial-scm.org/D7229
-
Gregory Szorc authored
Debian appears to cripple the venv module by default by removing the associated ensurepip functionality. (The module isn't present at all.) This caused test-install.t to fail when using the Debian python3 unless the python3-venv package was installed. This commit introduces a new hghave requirement for detecting ensurepip and makes the Python 3 install variant conditional on its presence. This should make test-install.t pass when using an incomplete Debian Python. Differential Revision: https://phab.mercurial-scm.org/D7228
-
- Oct 17, 2019
-
-
Matt Harbison authored
If a long-ish username is used, the environment variable ends up with a '~' to be 8.3 path compatible. That in turn causes a handful of tests (mostly ssh related) to add quotes around $TESTMP. I have no AWS experience, so I have no idea if this is the proper way to do it. But I've hit this problem locally, and redirecting the directory is a workaround. I don't recall if the directory is created on demand by the test harness, but presumably if this is configured before the machine boots, Windows will do it for us. Differential Revision: https://phab.mercurial-scm.org/D7130
-
- Nov 05, 2019
-
-
Gregory Szorc authored
This test was failing in some Python 3 environments because `$PYTHON -m virtualenv` was somehow resulting in Python 2 being used. Why, I'm not sure. Python 3 includes virtualenv in the standard library as the `venv` module. This commit changes test-install.t to use `$PYTHON -m venv` on Python 3 and `$PYTHON -m virtualenv` on Python 2 (if available). I chose to make some test output duplicated because we can't have nested conditionals and there is no easy way to express ORing of hghave checks. Differential Revision: https://phab.mercurial-scm.org/D7224
-
Gregory Szorc authored
This variable was removed from setup.py in c3e10f705a6c. Differential Revision: https://phab.mercurial-scm.org/D7223
-
Gregory Szorc authored
We were inserting str on Python 3 which resulted in mixed str/bytes types on the list. This would later blow up when trying to write str to the .err file opened in bytes mode. Differential Revision: https://phab.mercurial-scm.org/D7222
-
- Nov 04, 2019
-
-
Ian Moody authored
bb509f39d387 made an error, it's actually 3.7 that introduced token.COMMENT. Differential Revision: https://phab.mercurial-scm.org/D7220
-
Augie Fackler authored
-
Mathias De Mare authored
The resulting executable has not been tested in detail yet. I ran 'hg version' and 'hg clone', which worked fine (except for extensions acting up due to Python 3). Differential Revision: https://phab.mercurial-scm.org/D7216
-
Mathias De Mare authored
Differential Revision: https://phab.mercurial-scm.org/D7217
-
Ian Moody authored
Similar to 5fa8ac91190e / D7206, should get test-install.t passing on py3. Differential Revision: https://phab.mercurial-scm.org/D7218
-
Denis Laxalde authored
This improves the rendering of some exceptions by avoiding raw bytestrings, especially when using --traceback option.
-
Denis Laxalde authored
Similar to a973a75e92bf or 3e9c6cef949b.
-
- Nov 01, 2019
-
-
Gregory Szorc authored
This should unblock us from running the code formatting test in our automated environment. Differential Revision: https://phab.mercurial-scm.org/D7197
-
- Nov 02, 2019
-
-
Ian Moody authored
Avoids a TypeError under py3. Fortunately this is very much an edge case since it requires the user to have deliberately created a local tag of the form 'D\d+' that isn't truthful. Differential Revision: https://phab.mercurial-scm.org/D7215
-
Gregory Szorc authored
Unavailable.msg should now always be bytes. We also rename Unavailable.__str__ to __bytes__ as it always returns bytes. We make __str__ a simple wrapper that decodes that result to str. There's probably some excessive strutil.forcebytestr() in fsmonitor/__init__.py now. But at least the exceptions around type coercion should now be gone. Differential Revision: https://phab.mercurial-scm.org/D7214
-
Gregory Szorc authored
We normalize the value returned by watchman because we perform a number of compares with this value in code. So the easiest path forward is to normalize to bytes so we don't have to update many call sites. With this commit, the fsmonitor extension appears to be working with Python 3! Although there are still some failures in edge cases... Differential Revision: https://phab.mercurial-scm.org/D7213
-
Gregory Szorc authored
This is needed for Python 3 compatibility. Differential Revision: https://phab.mercurial-scm.org/D7212
-
Gregory Szorc authored
Otherwise it will be a str on Python 3 and operations below which operate in the bytes domain will fail. Differential Revision: https://phab.mercurial-scm.org/D7211
-
Gregory Szorc authored
In Python 3, keys in the bset tuple are typically str, not bytes. PyBytes_AsString() would return NULL. But we weren't checking the return value and this would lead to a segfault. This commit makes the code type and Python version aware. The Python version specific code is to allow us to utilize a modern API for converting str -> char* without having to allocate an extra PyObject. FWIW I wanted to assume that keys were always str. However, there appear to be some bytes keys in some cases. I haven't debugged this further. Differential Revision: https://phab.mercurial-scm.org/D7210
-
Gregory Szorc authored
The Hasher wants a bytes but we were feeding it a str. Let's use our repr() implementation to return bytes. In addition, the hexdigest() would return a str, which would be compared against a bytes and would always fail. Normalize to bytes so the compare works. Differential Revision: https://phab.mercurial-scm.org/D7209
-
Gregory Szorc authored
Without this, we get a str/bytes mismatching when using % formatting a few lines below. Differential Revision: https://phab.mercurial-scm.org/D7208
-
Gregory Szorc authored
There is no repo._root. It looks like fsmonitor has been busted since this access was introduced in ab1900323b1d in July 2019! Differential Revision: https://phab.mercurial-scm.org/D7207
-
Gregory Szorc authored
Without this, we get errors due to passing str to a function which expects bytes. Differential Revision: https://phab.mercurial-scm.org/D7206
-
Gregory Szorc authored
There were 2 bugs here. First, keys in the tuple are always str. Second, we needed to normalize the value to bytes to prevent a str/bytes mismatch on Python 3. With this commit, `hg debuginstall` with fsmonitor enabled now works on Python 3. Differential Revision: https://phab.mercurial-scm.org/D7205
-
Gregory Szorc authored
The recent revendoring of pywatchman undid this changeset. Let's reapply it. This commit was generated by running `hg graft -f b1f62cd39b5c`. It applied cleanly. Differential Revision: https://phab.mercurial-scm.org/D7204
-
Gregory Szorc authored
The recent revendoring of pywatchman undid this bug fix. Let's reapply it. Differential Revision: https://phab.mercurial-scm.org/D7203
-
Gregory Szorc authored
The recently vendored pywatchman code base is now formatted with black. We can now remove pywatchman from our black exclusion rule. Differential Revision: https://phab.mercurial-scm.org/D7202
-
Gregory Szorc authored
This commit vendors pywatchman commit 259dc66dc9591f9b7ce76d0275bb1065f390c9b1 from upstream without modifications. The previously vendored pywatchman from changeset 16f4b341288d was from Git commit c77452. This commit effectively undoes the following Mercurial changesets: * dd35abc409ee fsmonitor: correct an error message * b1f62cd39b5c fsmonitor: layer on another hack in bser.c for os.stat() compat (issue5811) * c31ce080eb75 py3: convert arguments, cwd and env to native strings when spawning subprocess * 876494fd967d cleanup: delete lots of unused local variables * 57264906a996 watchman: add the possibility to set the exact watchman binary location The newly-vendored code has support for specifying the binary location, so 57264906a996 does not need applied. But we do need to modify our code to specify a proper argument name. 876494fd967d is not important, so it will be ignored. c31ce080eb75 globally changed the code base to always pass str to subprocess. But pywatchman's code is Python 3 clean, so we don't need to do this. This leaves dd35abc409ee and b1f62cd39b5c, which will be re-applied in subsequent commits. Differential Revision: https://phab.mercurial-scm.org/D7201
-
- Nov 04, 2019
-
-
Denis Laxalde authored
-
Denis Laxalde authored
-
Denis Laxalde authored
We drop 'catlogparser' attribute now unused.
-
Denis Laxalde authored
This fixes this test on Python 3 with a long hostname. See changeset 4128ffba4431 for details.
-
- Nov 02, 2019
-
-
Gregory Szorc authored
Python 3.5's json.loads() requires a str. Only Python 3.6+ supports passing a bytes or bytearray. This commit implements a json.loads() polyfill on Python 3.5 so that we can use bytes. The added function to detect encodings comes verbatim from Python 3.7.
-
Gregory Szorc authored
This script makes use of `token.COMMENT`, which apparently isn't present until Python 3.6. So make the script and its test conditional on Python 3.6.
-
Gregory Szorc authored
There was an inline comment denoting a bug in the lazy extension loader on Python 3.5 which prevents it from working there. But the code was not conditional on the Python version. The result of this was a myriad of failures on Python 3.5 due to getattr() and friends not working on lazy extension modules. By making extension modules non-lazy on Python 3.5, we reduce the number of test failures from 48 to 22 on that Python version.
-
Gregory Szorc authored
I was using `hg absorb` with Python 3 and noticed that the prompt was appearing without any output about what would be done. After I answered the prompt, the output was printed to stdout. This appears to be a buffering difference between Python 2 and Python 3. To work around it, this commit adds an explicit flush() before calling the raw input function when readline is used.
-
Martin von Zweigbergk authored
I accidentally switched from 12 digits to 40 digits while making the code py3-compatible. Thanks to Yuya for noticing. Differential Revision: https://phab.mercurial-scm.org/D7200
-
- Oct 29, 2019
-
-
Martin von Zweigbergk authored
Differential Revision: https://phab.mercurial-scm.org/D7180
-
- Nov 01, 2019
-
-
Emmanuel Leblond authored
Differential Revision: https://phab.mercurial-scm.org/D7190
-