Pulkit Goyal <pulkit@yandex-team.ru> [Sat, 13 Oct 2018 04:08:53 +0300] rev 40217
py3: add b'' prefixes in tests/test-help.t
This takes us close to make the test passing.
# skip-blame because just b'' prefixes
Differential Revision: https://phab.mercurial-scm.org/D5028
Pulkit Goyal <pulkit@yandex-team.ru> [Sat, 13 Oct 2018 03:59:15 +0300] rev 40216
py3: use sys.stdout.buffer for binary output in tests/svnxml.py
Just following
6c0b1d964537ab62d76c208f5f04ab414814c94e here.
Differential Revision: https://phab.mercurial-scm.org/D5027
Pulkit Goyal <pulkit@yandex-team.ru> [Sat, 13 Oct 2018 03:58:20 +0300] rev 40215
py3: use '%s' instead of %r in hgext/convert/subversion.py
Using '%r' on bytes in python 3 adds b'' prefixes to output which is bad. I
don't see a reason why we want to repr() the string here, so just switched to
'%s'. This fixes some output failure in one of the subversion test.
Differential Revision: https://phab.mercurial-scm.org/D5026
Pulkit Goyal <pulkit@yandex-team.ru> [Sat, 13 Oct 2018 03:46:57 +0300] rev 40214
py3: make test-contrib-perf.t work on python 3
Differential Revision: https://phab.mercurial-scm.org/D5025
Pulkit Goyal <pulkit@yandex-team.ru> [Sat, 13 Oct 2018 03:32:12 +0300] rev 40213
py3: add 3 more passing tests to whitelist caught by buildbot
Differential Revision: https://phab.mercurial-scm.org/D5024
Pulkit Goyal <pulkit@yandex-team.ru> [Sat, 13 Oct 2018 00:35:37 +0300] rev 40212
py3: add some r'' prefixes in hgext/narrow/narrowwirepeer.py
This fixes test-narrow-widen-no-ellipsis.t on Python 3.
# skip-blame because just r'' prefixes
Differential Revision: https://phab.mercurial-scm.org/D5023
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 12 Oct 2018 19:49:02 +0200] rev 40211
py3: r'' prefix default values for mimetypes.guess_mime()
As suggested by @yuja in D4967.
Differential Revision: https://phab.mercurial-scm.org/D5020
Mark Thomas <mbthomas@fb.com> [Fri, 12 Oct 2018 20:03:29 +0000] rev 40210
absorb: update help text
Update the help text to reflect the recent changes to absorb in D4999.
The `-p` option actually only affects the `-a` option: without `-a`, the
changes are printed; with `-a` the changes are only printed if `-p` is
specified. Reword the help text for `-p` to reflect this.
Differential Revision: https://phab.mercurial-scm.org/D5022
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Fri, 12 Oct 2018 16:45:46 +0900] rev 40209
fsmonitor: use vfs instead of opener (
issue5938)
"opener" of localrepository object was dropped at Mercurial 4.3 (or
a7e210167c28). "vfs" should be used instead.
wlock is required to write into a file under .hg directory.
For efficiency, we should change _cmpsets() from:
1. acquire wlock
2. open log file under .hg directory with write mode
3. compare between result of watchman and Mercurial's dirstate logic
4. write out error info into a file, if error is detected
5. release wlock
to:
1. compare between result of watchman and Mercurial's dirstate logic
2. acquire wlock, if error is detected
3. open and write error info into a file
4. release wlock
But this is another issue.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Fri, 12 Oct 2018 16:07:08 +0900] rev 40208
tests: configure fsmonitor.mode=paranoid always if fsmonitor is used
This forces fsmonitor extension execute "paranoid" code path.
Strict speaking, we should make fsmonitor-run-tests.py accept own
specific options, but there is no code path, which is disabled in
"paranoid" mode, at least now. Therefore, this solution seems
reasonable enough.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 08 Oct 2018 13:12:06 +0900] rev 40207
tests: drop files from exclusion list in test-check-module-imports.t
Now, these files has no style issue at checking with import-checker.py.
BTW, tests/test-imports-checker.t is still excluded, because almost
all code fragments in it has intentional importing style violation.
Using NO_CHECK_EOF instead of EOF as heredoc limit mark can make
import-checker.py ignore such fragments. But keeping these fragments
checkable seems still useful: for example, test-imports-checker.t can
be used to test whether import-checker.py can detect erroneous code
fragment in test script as expected.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 08 Oct 2018 12:03:04 +0900] rev 40206
tests: use NO_CHECK_EOF for fragments used to test importing via extension
test-extension.t is excluded in test-check-module-imports.t, because
import-checker.py reports that some python code fragments in it does
not import modules in recommended style.
These code fragments are used to test importing modules relatively and
absolutely via extension (e.g.
issue4029,
issue5208, and so on). Test
specific package hierarchy becomes complicated for this purpose, and
it seems reasonable to avoid checking these code fragments with
import-checker.py.
But on the other hand, other code fragments in test-extension.t should
be checked by import-checker.py.
Therefore, this patch uses NO_CHECK_EOF limit mark only for python
code fragments, which are used to test importing via extension in
test-extension.t. NO_CHECK_EOF limit mark tells import-checker.py that
this code fragment should be ignored, via testparseutil.py.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 08 Oct 2018 10:30:59 +0900] rev 40205
tests: use NO_CHECK_EOF for fragments having intentional error
Some test scripts are excluded in test-check-module-imports.t, because
import-checker.py reports that code fragments embedded in these test
scripts have syntax error. But these syntax error is intentional.
This patch uses NO_CHECK_EOF instead of EOF as heredoc limit mark for
such fragments, in order to make import-checker.py ignore
them. NO_CHECK_EOF limit mark tells import-checker.py that this code
fragment should be ignored, via testparseutil.py.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 08 Oct 2018 10:45:36 +0900] rev 40204
tests: fix style issue of importing order in test-lock.py
test-lock.py is excluded in test-check-module-imports.t, because
import-checker.py reports that some stdlibs are imported after local
silenttestrunner module.
I can not found out any reason why tests/silenttestrunner.py should be
imported before some stdlibs from the point of functionality view.
FUJIWARA Katsunori <foozy@lares.dti.ne.jp> [Mon, 08 Oct 2018 10:10:06 +0900] rev 40203
tests: fix style issue of importing hgweb in embedded code fragments
Some test scripts are excluded in test-check-module-imports.t, because
import-checker.py reports that hgweb and/or hgwebdir of
mercurial.hgweb are not imported in recommended style.
To fix this issues, this patch make python code fragments embedded in
these files import hgweb from mercurial package at first, and refer
hgweb and hgwebdir via imported hgweb.
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 12 Oct 2018 18:20:17 +0200] rev 40202
py3: encode str to bytes
These fields are str on Python 2 and 3. This module doesn't import any Mercurial
modules. So I just did the str -> bytes inline.
Differential Revision: https://phab.mercurial-scm.org/D5010
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 12 Oct 2018 19:00:24 +0200] rev 40201
py3: sprinkle statprof.py with utf-8 encoding
Trying to chase the long tail of unicode badness in this file due to
frame / code objects holding str everywhere.
Differential Revision: https://phab.mercurial-scm.org/D5016
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 12 Oct 2018 19:17:22 +0200] rev 40200
py3: flush stdout
This avoids buffering due to mixed print() and sys.stdout.write() by
profiling code.
And with this, test-profile.t passes on Python 3 \o/.
Honestly, I'd be shocked if there weren't more Python 3 encoding issues lingering
in the profiling code. That code isn't super high quality and doesn't seem to have
thorough test coverage.
Differential Revision: https://phab.mercurial-scm.org/D5018
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 12 Oct 2018 19:07:12 +0200] rev 40199
py3: use raw strings in statprof.py
This allows main() and argument parsing to work.
Differential Revision: https://phab.mercurial-scm.org/D5017
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 12 Oct 2018 18:51:10 +0200] rev 40198
py3: switch from print(..., file=) to write()
Because Python 3's print() doesn't like bytes.
Differential Revision: https://phab.mercurial-scm.org/D5015
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 12 Oct 2018 18:40:32 +0200] rev 40197
py3: use %d in a few places
Differential Revision: https://phab.mercurial-scm.org/D5014
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 12 Oct 2018 18:37:42 +0200] rev 40196
py3: use raw strings for stack names
These are used for simple compares. We don't need to normalize to bytes.
As part of this, I expanded a set literal so entries are 1 per line.
Differential Revision: https://phab.mercurial-scm.org/D5013
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 12 Oct 2018 18:30:40 +0200] rev 40195
py3: use sysbytes for converting code attributes
Differential Revision: https://phab.mercurial-scm.org/D5012
Gregory Szorc <gregory.szorc@gmail.com> [Fri, 12 Oct 2018 18:26:10 +0200] rev 40194
py3: use write() instead of print()
Because print() expects str and we want to write bytes.
There should be no functional changes as part of this.
Differential Revision: https://phab.mercurial-scm.org/D5011