# HG changeset patch # User Yuya Nishihara # Date 1493211079 -32400 # Node ID 41d79475d440f5de510a9805338ec88c0fa8d339 # Parent ac641a41f98d4912ac070152b1640e613e9460d5 check-code: exclude demandimport.py and policy.py from Python 3 checks These modules can't depend on pycompat.py, which means we have to write Py3 hacks in them. diff -r ac641a41f98d -r 41d79475d440 contrib/check-code.py --- a/contrib/check-code.py Mon May 01 17:10:22 2017 +0900 +++ b/contrib/check-code.py Wed Apr 26 21:51:19 2017 +0900 @@ -492,8 +492,8 @@ checks = [ ('python', r'.*\.(py|cgi)$', r'^#!.*python', pyfilters, pypats), ('python', r'.*hgext.*\.py$', '', [], pyextnfpats), - ('python 3', r'.*(hgext|mercurial)/(?!pycompat).*\.py', '', - pyfilters, py3pats), + ('python 3', r'.*(hgext|mercurial)/(?!demandimport|policy|pycompat).*\.py', + '', pyfilters, py3pats), ('test script', r'(.*/)?test-[^.~]*$', '', testfilters, testpats), ('c', r'.*\.[ch]$', '', cfilters, cpats), ('unified test', r'.*\.t$', '', utestfilters, utestpats), diff -r ac641a41f98d -r 41d79475d440 tests/test-check-code.t --- a/tests/test-check-code.t Mon May 01 17:10:22 2017 +0900 +++ b/tests/test-check-code.t Wed Apr 26 21:51:19 2017 +0900 @@ -13,9 +13,6 @@ > r.revision(r.node(x)) don't convert rev to node before passing to revision(nodeorrev) Skipping i18n/polib.py it has no-che?k-code (glob) - mercurial/demandimport.py:314: - > if os.environ.get('HGDEMANDIMPORT') != 'disable': - use encoding.environ instead (py3) mercurial/encoding.py:54: > environ = os.environ use encoding.environ instead (py3) @@ -30,15 +27,6 @@ use encoding.environ instead (py3) Skipping mercurial/httpclient/__init__.py it has no-che?k-code (glob) Skipping mercurial/httpclient/_readers.py it has no-che?k-code (glob) - mercurial/policy.py:46: - > if 'HGMODULEPOLICY' in os.environ: - use encoding.environ instead (py3) - mercurial/policy.py:47: - > policy = os.environ['HGMODULEPOLICY'].encode('utf-8') - use encoding.environ instead (py3) - mercurial/policy.py:49: - > policy = os.environ.get('HGMODULEPOLICY', policy) - use encoding.environ instead (py3) Skipping mercurial/statprof.py it has no-che?k-code (glob) Skipping tests/badserverext.py it has no-che?k-code (glob) [1]