Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 09:07:00 -0800] rev 41533
global: make some docstrings raw strings
Python 3.8 emits a SyntaxWarning when a str/bytes contains invalid
\ escapes. Various docstrings in our code base contain invalid
\ escapes.
This commit turns those docstrings into raw strings.
Differential Revision: https://phab.mercurial-scm.org/D5816
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 08:54:30 -0800] rev 41532
global: use raw strings for regular expressions with escapes
Escape sequences like \w, \s, and \d are technically invalid
in str/bytes. This became a deprecation warning in Python 3.6
(https://bugs.python.org/
issue27364). Python 3.8 bumps it to
a SyntaxWarning (https://bugs.python.org/
issue32912), which is
non-silent by default.
This commit changes a number of regular expressions to use
br'' so regular expression special sequences don't need \\
literals. This fixes roughly half of the SyntaxWarning we
see in the code base with Python 3.8.
Differential Revision: https://phab.mercurial-scm.org/D5815
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 04 Feb 2019 09:29:25 -0800] rev 41531
tests: add optional Python 2.7 deprecation output
pip 19 will emit a Python 2.7 deprecation warning when used with
Python 2.7. Let's add that as optional output to our pip test.
Differential Revision: https://phab.mercurial-scm.org/D5823
Augie Fackler <augie@google.com> [Mon, 04 Feb 2019 17:06:22 -0500] rev 41530
tests: fix test-match.py on Python3
# skip-blame just b prefixes
Differential Revision: https://phab.mercurial-scm.org/D5835
Pulkit Goyal <pulkit@yandex-team.ru> [Mon, 04 Feb 2019 20:35:21 +0300] rev 41529
merge with stable
Pulkit Goyal <pulkit@yandex-team.ru> [Mon, 04 Feb 2019 18:14:03 +0300] rev 41528
match: teach diffmatcher.visitdir() to return 'all' if possible
This patch teaches differencematcher.visitdir() to return 'all' when
m1.visitdir() returns 'all' and m2 does not matches.
Before this patch, from a differencematcher.visitdir(), we always returned
either True or False. We never returned 'all' even when we can. This causes
problem when m1 and m2 of a differencematcher are themselves differencematcher.
In that case, we try to check:
`if self._m2_.visitdir(dir) == 'all'`
which will never be 'all' even though it can be.
This leads to iterating over a lot of sub-directory manifest, even though we
don't want to while extending a narrow clone. I am yet to measure the impact of
this but calculating manifest was taking ~50-60 seconds, so this should
definitely save some of time there.
Differential Revision: https://phab.mercurial-scm.org/D5814
Boris Feld <boris.feld@octobus.net> [Sun, 03 Feb 2019 10:01:43 +0100] rev 41527
py3: use integer division instead of `int(...)` call
Changeset
38a82e0333c9 and
7f853549823b introduced explicit conversion to
integer to work around the division behavior change from python2 to python3.
Using the integer division operator is a simpler and clearer way to achieve
this.
Pulkit Goyal <pulkit@yandex-team.ru> [Sun, 03 Feb 2019 17:15:11 +0530] rev 41526
py3: add some b'' prefixes in test-notify.t
# skip-blame as just b'' prefixes
Differential Revision: https://phab.mercurial-scm.org/D5811
Pulkit Goyal <pulkit@yandex-team.ru> [Sun, 03 Feb 2019 17:05:47 +0530] rev 41525
py3: use pycompat.long in hgext/convert/monotone.py
Differential Revision: https://phab.mercurial-scm.org/D5810
Pulkit Goyal <pulkit@yandex-team.ru> [Sun, 03 Feb 2019 16:59:46 +0530] rev 41524
py3: add three new passing tests found by buildbot
Differential Revision: https://phab.mercurial-scm.org/D5809
Pulkit Goyal <pulkit@yandex-team.ru> [Sun, 03 Feb 2019 16:38:47 +0530] rev 41523
py3: do a fsdecode(), fsencode() dance in posix.py
We have to use `fsdecode()` instead of sysstr() because they are abusing
`PyUnicode_EncodeFSDefault()` to get back bytes.
Differential Revision: https://phab.mercurial-scm.org/D5808
Taapas Agrawal <taapas2897@gmail.com> [Sun, 03 Feb 2019 01:02:24 +0530] rev 41522
revert: add prompt before undeleting a file in -i (
issue6008)
This adds a prompt that asks whether or not a removed file is to be undeleted
in `hg revert -i`.
Differential Revision: https://phab.mercurial-scm.org/D5803
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 02 Feb 2019 13:16:46 -0800] rev 41521
py3: add alternate output on Python 3
This is basically the same deal as D5806. Python 3's exception
printing output is different.
We had to tweak the regular expression to match appropriately,
hence the added line of output.
Differential Revision: https://phab.mercurial-scm.org/D5807
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 02 Feb 2019 13:13:22 -0800] rev 41520
py3: add Python 3 output for test-flagprocessor.t
The exception is being generated from ui.traceback(), which
simply calls traceback.format_*() to format exceptions. Since
the output from the standard library has changed, there is
seemingly not much we can do about it. So this commit adds
conditional output depending on the Python version.
I'm not thrilled about b'' appearing in user-facing output.
Can we do something better here?
Differential Revision: https://phab.mercurial-scm.org/D5806
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 02 Feb 2019 11:49:26 -0800] rev 41519
zeroconf: Python 3 porting of vendored library
A quick glance through this module reveals that most of it "just works"
on Python 3 with the source transformer active. There are a few
places where we need to ensure we're using str.
Differential Revision: https://phab.mercurial-scm.org/D5804
Anton Shestakov <av6@dwimlabs.net> [Tue, 22 Jan 2019 14:22:25 +0800] rev 41518
relnotes: more improvements
Yuya Nishihara <yuya@tcha.org> [Sat, 02 Feb 2019 15:26:51 +0900] rev 41517
py3: don't use universal_newlines in svnsubrepo
On Python 3, it means text=True without any specific encoding, which is
pretty bad. Instead, use util.fromnativeeol() to translate CR+LF to LF
without encoding conversion.
Yuya Nishihara <yuya@tcha.org> [Sat, 02 Feb 2019 15:21:35 +0900] rev 41516
py3: remove unneeded fsencode() from gitsubrepo
Here p.stdout isn't a TextIO. read() must return bytes.
Martin von Zweigbergk <martinvonz@google.com> [Fri, 25 Jan 2019 14:41:53 -0800] rev 41515
debugcommands: add a debugpathcopies command
I've been working on storing copy metadata in the changelog instead of
the filelog and this has been useful for debugging.
Do we usually add tests for these?
Differential Revision: https://phab.mercurial-scm.org/D5791
Augie Fackler <augie@google.com> [Fri, 01 Feb 2019 20:21:04 -0500] rev 41514
py3: record several more passes from the buildbot ratchet
Differential Revision: https://phab.mercurial-scm.org/D5799
Martin von Zweigbergk <martinvonz@google.com> [Wed, 30 Jan 2019 17:05:09 -0800] rev 41513
grep: respect ui.relative-paths
Differential Revision: https://phab.mercurial-scm.org/D5777
Martin von Zweigbergk <martinvonz@google.com> [Wed, 30 Jan 2019 16:59:31 -0800] rev 41512
grep: move writing of path outside of column loop
This will make the next patch simpler.
Differential Revision: https://phab.mercurial-scm.org/D5776
Martin von Zweigbergk <martinvonz@google.com> [Tue, 29 Jan 2019 12:01:13 -0800] rev 41511
resolve: respect ui.relative-paths
Differential Revision: https://phab.mercurial-scm.org/D5748
Martin von Zweigbergk <martinvonz@google.com> [Wed, 30 Jan 2019 12:05:43 -0800] rev 41510
merge: respect ui.relative-paths
We print file paths in a lot of places in this code and I've probably
missed a few places. We can fix them as we discover them (I'm also
happy to fix anything reviewers notice, of course).
Differential Revision: https://phab.mercurial-scm.org/D5747
Augie Fackler <augie@google.com> [Tue, 29 Jan 2019 18:46:11 -0500] rev 41509
histedit: add templating support to histedit's rule file generation
This will allow users to customize the display of the rule list for the
free-form segment that we don't interpret. We've had users want to add things
like bookmark names or similar to the rule list as a convenience, which seems
reasonable.
Differential Revision: https://phab.mercurial-scm.org/D5742
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 01 Feb 2019 17:03:51 -0800] rev 41508
py3: account for demand import difference between Python versions
Our lazy importer for Python 3 will validate that modules are
loadable before returning a stub module object. This is different
from Python 2, which will always return a stub module object.
While we could change behavior of the Python 3 demand importer,
that seems like a problem for another day.
This commit teaches test-extension.t about that difference in
behavior.
Differential Revision: https://phab.mercurial-scm.org/D5798
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 01 Feb 2019 13:20:13 -0800] rev 41507
tests: use unimported modules in test-demandimport.py
contextlib isn't a good module to test because it is likely already
imported by code above. Let's use modules that shouldn't have been
imported. And let's verify that with asserts.
Differential Revision: https://phab.mercurial-scm.org/D5797
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 01 Feb 2019 16:47:29 -0800] rev 41506
py3: conditionalize test-demandimport.py for Python 3
The Python 3 lazy importer uses the LazyLoader that is part of
importlib.
On Python 3 and later, LazyLoader is implemented using a custom module
type that defines a __getattribute__ which triggers module loading.
Furthermore, there are additional differences as well. For example,
it appears that Python 3 will return an existing sys.modules
entry instead of constructing a new module object.
This commit adds additional test coverage for lazy importing
behavior to cover the differences between Python 2 and 3. This
reveals that the test and some lazy import functionality is kinda
busted. For example, the test assumes "contextlib" will be lazy.
But in reality an import before it has already imported contextlib!
There's definitely room to improve the behavior of the demand
importer code, both for Python 2 and 3. But at least the test
passes on Python 3 now.
Differential Revision: https://phab.mercurial-scm.org/D5796