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