[PATCH 1 of 8] py3: make contrib/check-commit use absolute_import

Yuya Nishihara yuya at tcha.org
Sun May 15 09:10:25 EDT 2016


On Thu, 12 May 2016 15:54:54 -0500, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pulkit at gmail.com>
> # Date 1463085717 -19800
> #      Fri May 13 02:11:57 2016 +0530
> # Node ID b203e6318c6e6bce968d41990efebc8c17ca49ec
> # Parent  df838803c1d487e4601f96c6cfd85e6ad4f6291f
> py3: make contrib/check-commit use absolute_import

Pushing 1, 2, 3, 4, and 8 to the committed repo, thanks.

I have a couple of fixes on import-checker and it reported problems for
the other patches:

% ./run-tests.py -l test-check-module-imports.t test-check-pyflakes.t
--- /home/yuya/work/hghacks/mercurial-work/tests/test-check-module-imports.t
+++ /home/yuya/work/hghacks/mercurial-work/tests/test-check-module-imports.t.err
@@ -178,5 +178,11 @@
   > -X tests/test-hgweb-no-request-uri.t \
   > -X tests/test-hgweb-non-interactive.t \
   > | sed 's-\\-/-g' | python "$import_checker" -
+  contrib/hg-ssh:37: stdlib import "os" follows local import: mercurial
+  contrib/hg-ssh:38: stdlib import "shlex" follows local import: mercurial
+  contrib/hg-ssh:39: stdlib import "sys" follows local import: mercurial
+  contrib/hgperf:59: direct symbol import disptach from mercurial
+  contrib/simplemerge:8: stdlib import "sys" follows local import: mercurial
+  contrib/simplemerge:9: symbol import follows non-symbol import: mercurial.i18n
   Import cycle: hgext.largefiles.basestore -> hgext.largefiles.localstore -> hgext.largefiles.basestore
   [1]

ERROR: test-check-module-imports.t output changed
!
--- /home/yuya/work/hghacks/mercurial-work/tests/test-check-pyflakes.t
+++ /home/yuya/work/hghacks/mercurial-work/tests/test-check-pyflakes.t.err
@@ -7,6 +7,12 @@
 
   $ hg locate 'set:**.py or grep("^#!.*python")' 2>/dev/null \
   > | xargs pyflakes 2>/dev/null | "$TESTDIR/filterpyflakes.py"
+  contrib/hgperf:59: 'mercurial.disptach' imported but unused
+  contrib/hgperf:59: 'mercurial.util' imported but unused
+  contrib/hgperf:89: undefined name 'mercurial'
+  contrib/hgperf:99: undefined name 'mercurial'
+  contrib/hgperf:102: undefined name 'mercurial'
+  contrib/hgperf:104: undefined name 'mercurial'
   tests/filterpyflakes.py:61: undefined name 'undefinedname'


More information about the Mercurial-devel mailing list