##// END OF EJS Templates
casesmash: use absolute_import
Pulkit Goyal -
r28351:42a7301f default
parent child Browse files
Show More
@@ -1,34 +1,38 b''
1 import os, __builtin__
1 from __future__ import absolute_import
2 from mercurial import util
2 import __builtin__
3 import os
4 from mercurial import (
5 util,
6 )
3
7
4 def lowerwrap(scope, funcname):
8 def lowerwrap(scope, funcname):
5 f = getattr(scope, funcname)
9 f = getattr(scope, funcname)
6 def wrap(fname, *args, **kwargs):
10 def wrap(fname, *args, **kwargs):
7 d, base = os.path.split(fname)
11 d, base = os.path.split(fname)
8 try:
12 try:
9 files = os.listdir(d or '.')
13 files = os.listdir(d or '.')
10 except OSError:
14 except OSError:
11 files = []
15 files = []
12 if base in files:
16 if base in files:
13 return f(fname, *args, **kwargs)
17 return f(fname, *args, **kwargs)
14 for fn in files:
18 for fn in files:
15 if fn.lower() == base.lower():
19 if fn.lower() == base.lower():
16 return f(os.path.join(d, fn), *args, **kwargs)
20 return f(os.path.join(d, fn), *args, **kwargs)
17 return f(fname, *args, **kwargs)
21 return f(fname, *args, **kwargs)
18 scope.__dict__[funcname] = wrap
22 scope.__dict__[funcname] = wrap
19
23
20 def normcase(path):
24 def normcase(path):
21 return path.lower()
25 return path.lower()
22
26
23 os.path.normcase = normcase
27 os.path.normcase = normcase
24
28
25 for f in 'file open'.split():
29 for f in 'file open'.split():
26 lowerwrap(__builtin__, f)
30 lowerwrap(__builtin__, f)
27
31
28 for f in "chmod chown open lstat stat remove unlink".split():
32 for f in "chmod chown open lstat stat remove unlink".split():
29 lowerwrap(os, f)
33 lowerwrap(os, f)
30
34
31 for f in "exists lexists".split():
35 for f in "exists lexists".split():
32 lowerwrap(os.path, f)
36 lowerwrap(os.path, f)
33
37
34 lowerwrap(util, 'posixfile')
38 lowerwrap(util, 'posixfile')
@@ -1,167 +1,166 b''
1 #require test-repo
1 #require test-repo
2
2
3 $ cd "$TESTDIR"/..
3 $ cd "$TESTDIR"/..
4
4
5 $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs python contrib/check-py3-compat.py
5 $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs python contrib/check-py3-compat.py
6 contrib/casesmash.py not using absolute_import
7 contrib/check-code.py not using absolute_import
6 contrib/check-code.py not using absolute_import
8 contrib/check-code.py requires print_function
7 contrib/check-code.py requires print_function
9 contrib/check-config.py not using absolute_import
8 contrib/check-config.py not using absolute_import
10 contrib/check-config.py requires print_function
9 contrib/check-config.py requires print_function
11 contrib/debugcmdserver.py not using absolute_import
10 contrib/debugcmdserver.py not using absolute_import
12 contrib/debugcmdserver.py requires print_function
11 contrib/debugcmdserver.py requires print_function
13 contrib/debugshell.py not using absolute_import
12 contrib/debugshell.py not using absolute_import
14 contrib/fixpax.py not using absolute_import
13 contrib/fixpax.py not using absolute_import
15 contrib/fixpax.py requires print_function
14 contrib/fixpax.py requires print_function
16 contrib/hgclient.py not using absolute_import
15 contrib/hgclient.py not using absolute_import
17 contrib/hgclient.py requires print_function
16 contrib/hgclient.py requires print_function
18 contrib/hgfixes/fix_bytes.py not using absolute_import
17 contrib/hgfixes/fix_bytes.py not using absolute_import
19 contrib/hgfixes/fix_bytesmod.py not using absolute_import
18 contrib/hgfixes/fix_bytesmod.py not using absolute_import
20 contrib/hgfixes/fix_leftover_imports.py not using absolute_import
19 contrib/hgfixes/fix_leftover_imports.py not using absolute_import
21 contrib/import-checker.py not using absolute_import
20 contrib/import-checker.py not using absolute_import
22 contrib/import-checker.py requires print_function
21 contrib/import-checker.py requires print_function
23 contrib/memory.py not using absolute_import
22 contrib/memory.py not using absolute_import
24 contrib/perf.py not using absolute_import
23 contrib/perf.py not using absolute_import
25 contrib/python-hook-examples.py not using absolute_import
24 contrib/python-hook-examples.py not using absolute_import
26 contrib/revsetbenchmarks.py not using absolute_import
25 contrib/revsetbenchmarks.py not using absolute_import
27 contrib/revsetbenchmarks.py requires print_function
26 contrib/revsetbenchmarks.py requires print_function
28 contrib/showstack.py not using absolute_import
27 contrib/showstack.py not using absolute_import
29 contrib/synthrepo.py not using absolute_import
28 contrib/synthrepo.py not using absolute_import
30 contrib/win32/hgwebdir_wsgi.py not using absolute_import
29 contrib/win32/hgwebdir_wsgi.py not using absolute_import
31 doc/check-seclevel.py not using absolute_import
30 doc/check-seclevel.py not using absolute_import
32 doc/gendoc.py not using absolute_import
31 doc/gendoc.py not using absolute_import
33 doc/hgmanpage.py not using absolute_import
32 doc/hgmanpage.py not using absolute_import
34 hgext/__init__.py not using absolute_import
33 hgext/__init__.py not using absolute_import
35 hgext/color.py not using absolute_import
34 hgext/color.py not using absolute_import
36 hgext/convert/__init__.py not using absolute_import
35 hgext/convert/__init__.py not using absolute_import
37 hgext/convert/bzr.py not using absolute_import
36 hgext/convert/bzr.py not using absolute_import
38 hgext/convert/common.py not using absolute_import
37 hgext/convert/common.py not using absolute_import
39 hgext/convert/convcmd.py not using absolute_import
38 hgext/convert/convcmd.py not using absolute_import
40 hgext/convert/cvs.py not using absolute_import
39 hgext/convert/cvs.py not using absolute_import
41 hgext/convert/cvsps.py not using absolute_import
40 hgext/convert/cvsps.py not using absolute_import
42 hgext/convert/darcs.py not using absolute_import
41 hgext/convert/darcs.py not using absolute_import
43 hgext/convert/filemap.py not using absolute_import
42 hgext/convert/filemap.py not using absolute_import
44 hgext/convert/git.py not using absolute_import
43 hgext/convert/git.py not using absolute_import
45 hgext/convert/gnuarch.py not using absolute_import
44 hgext/convert/gnuarch.py not using absolute_import
46 hgext/convert/hg.py not using absolute_import
45 hgext/convert/hg.py not using absolute_import
47 hgext/convert/monotone.py not using absolute_import
46 hgext/convert/monotone.py not using absolute_import
48 hgext/convert/p4.py not using absolute_import
47 hgext/convert/p4.py not using absolute_import
49 hgext/convert/subversion.py not using absolute_import
48 hgext/convert/subversion.py not using absolute_import
50 hgext/convert/transport.py not using absolute_import
49 hgext/convert/transport.py not using absolute_import
51 hgext/eol.py not using absolute_import
50 hgext/eol.py not using absolute_import
52 hgext/extdiff.py not using absolute_import
51 hgext/extdiff.py not using absolute_import
53 hgext/factotum.py not using absolute_import
52 hgext/factotum.py not using absolute_import
54 hgext/fetch.py not using absolute_import
53 hgext/fetch.py not using absolute_import
55 hgext/gpg.py not using absolute_import
54 hgext/gpg.py not using absolute_import
56 hgext/graphlog.py not using absolute_import
55 hgext/graphlog.py not using absolute_import
57 hgext/hgcia.py not using absolute_import
56 hgext/hgcia.py not using absolute_import
58 hgext/hgk.py not using absolute_import
57 hgext/hgk.py not using absolute_import
59 hgext/highlight/__init__.py not using absolute_import
58 hgext/highlight/__init__.py not using absolute_import
60 hgext/highlight/highlight.py not using absolute_import
59 hgext/highlight/highlight.py not using absolute_import
61 hgext/histedit.py not using absolute_import
60 hgext/histedit.py not using absolute_import
62 hgext/largefiles/__init__.py not using absolute_import
61 hgext/largefiles/__init__.py not using absolute_import
63 hgext/largefiles/basestore.py not using absolute_import
62 hgext/largefiles/basestore.py not using absolute_import
64 hgext/largefiles/lfcommands.py not using absolute_import
63 hgext/largefiles/lfcommands.py not using absolute_import
65 hgext/largefiles/lfutil.py not using absolute_import
64 hgext/largefiles/lfutil.py not using absolute_import
66 hgext/largefiles/localstore.py not using absolute_import
65 hgext/largefiles/localstore.py not using absolute_import
67 hgext/largefiles/overrides.py not using absolute_import
66 hgext/largefiles/overrides.py not using absolute_import
68 hgext/largefiles/proto.py not using absolute_import
67 hgext/largefiles/proto.py not using absolute_import
69 hgext/largefiles/remotestore.py not using absolute_import
68 hgext/largefiles/remotestore.py not using absolute_import
70 hgext/largefiles/reposetup.py not using absolute_import
69 hgext/largefiles/reposetup.py not using absolute_import
71 hgext/largefiles/uisetup.py not using absolute_import
70 hgext/largefiles/uisetup.py not using absolute_import
72 hgext/largefiles/wirestore.py not using absolute_import
71 hgext/largefiles/wirestore.py not using absolute_import
73 hgext/mq.py not using absolute_import
72 hgext/mq.py not using absolute_import
74 hgext/notify.py not using absolute_import
73 hgext/notify.py not using absolute_import
75 hgext/patchbomb.py not using absolute_import
74 hgext/patchbomb.py not using absolute_import
76 hgext/purge.py not using absolute_import
75 hgext/purge.py not using absolute_import
77 hgext/rebase.py not using absolute_import
76 hgext/rebase.py not using absolute_import
78 hgext/record.py not using absolute_import
77 hgext/record.py not using absolute_import
79 hgext/relink.py not using absolute_import
78 hgext/relink.py not using absolute_import
80 hgext/schemes.py not using absolute_import
79 hgext/schemes.py not using absolute_import
81 hgext/share.py not using absolute_import
80 hgext/share.py not using absolute_import
82 hgext/shelve.py not using absolute_import
81 hgext/shelve.py not using absolute_import
83 hgext/strip.py not using absolute_import
82 hgext/strip.py not using absolute_import
84 hgext/transplant.py not using absolute_import
83 hgext/transplant.py not using absolute_import
85 hgext/win32mbcs.py not using absolute_import
84 hgext/win32mbcs.py not using absolute_import
86 hgext/win32text.py not using absolute_import
85 hgext/win32text.py not using absolute_import
87 i18n/check-translation.py not using absolute_import
86 i18n/check-translation.py not using absolute_import
88 i18n/polib.py not using absolute_import
87 i18n/polib.py not using absolute_import
89 setup.py not using absolute_import
88 setup.py not using absolute_import
90 tests/filterpyflakes.py requires print_function
89 tests/filterpyflakes.py requires print_function
91 tests/generate-working-copy-states.py requires print_function
90 tests/generate-working-copy-states.py requires print_function
92 tests/get-with-headers.py requires print_function
91 tests/get-with-headers.py requires print_function
93 tests/heredoctest.py requires print_function
92 tests/heredoctest.py requires print_function
94 tests/hypothesishelpers.py not using absolute_import
93 tests/hypothesishelpers.py not using absolute_import
95 tests/hypothesishelpers.py requires print_function
94 tests/hypothesishelpers.py requires print_function
96 tests/killdaemons.py not using absolute_import
95 tests/killdaemons.py not using absolute_import
97 tests/md5sum.py not using absolute_import
96 tests/md5sum.py not using absolute_import
98 tests/mockblackbox.py not using absolute_import
97 tests/mockblackbox.py not using absolute_import
99 tests/printenv.py not using absolute_import
98 tests/printenv.py not using absolute_import
100 tests/readlink.py not using absolute_import
99 tests/readlink.py not using absolute_import
101 tests/readlink.py requires print_function
100 tests/readlink.py requires print_function
102 tests/revlog-formatv0.py not using absolute_import
101 tests/revlog-formatv0.py not using absolute_import
103 tests/run-tests.py not using absolute_import
102 tests/run-tests.py not using absolute_import
104 tests/seq.py not using absolute_import
103 tests/seq.py not using absolute_import
105 tests/seq.py requires print_function
104 tests/seq.py requires print_function
106 tests/silenttestrunner.py not using absolute_import
105 tests/silenttestrunner.py not using absolute_import
107 tests/silenttestrunner.py requires print_function
106 tests/silenttestrunner.py requires print_function
108 tests/sitecustomize.py not using absolute_import
107 tests/sitecustomize.py not using absolute_import
109 tests/svn-safe-append.py not using absolute_import
108 tests/svn-safe-append.py not using absolute_import
110 tests/svnxml.py not using absolute_import
109 tests/svnxml.py not using absolute_import
111 tests/test-ancestor.py requires print_function
110 tests/test-ancestor.py requires print_function
112 tests/test-atomictempfile.py not using absolute_import
111 tests/test-atomictempfile.py not using absolute_import
113 tests/test-batching.py not using absolute_import
112 tests/test-batching.py not using absolute_import
114 tests/test-batching.py requires print_function
113 tests/test-batching.py requires print_function
115 tests/test-bdiff.py not using absolute_import
114 tests/test-bdiff.py not using absolute_import
116 tests/test-bdiff.py requires print_function
115 tests/test-bdiff.py requires print_function
117 tests/test-context.py not using absolute_import
116 tests/test-context.py not using absolute_import
118 tests/test-context.py requires print_function
117 tests/test-context.py requires print_function
119 tests/test-demandimport.py not using absolute_import
118 tests/test-demandimport.py not using absolute_import
120 tests/test-demandimport.py requires print_function
119 tests/test-demandimport.py requires print_function
121 tests/test-dispatch.py not using absolute_import
120 tests/test-dispatch.py not using absolute_import
122 tests/test-dispatch.py requires print_function
121 tests/test-dispatch.py requires print_function
123 tests/test-doctest.py not using absolute_import
122 tests/test-doctest.py not using absolute_import
124 tests/test-duplicateoptions.py not using absolute_import
123 tests/test-duplicateoptions.py not using absolute_import
125 tests/test-duplicateoptions.py requires print_function
124 tests/test-duplicateoptions.py requires print_function
126 tests/test-filecache.py not using absolute_import
125 tests/test-filecache.py not using absolute_import
127 tests/test-filecache.py requires print_function
126 tests/test-filecache.py requires print_function
128 tests/test-filelog.py not using absolute_import
127 tests/test-filelog.py not using absolute_import
129 tests/test-filelog.py requires print_function
128 tests/test-filelog.py requires print_function
130 tests/test-hg-parseurl.py not using absolute_import
129 tests/test-hg-parseurl.py not using absolute_import
131 tests/test-hg-parseurl.py requires print_function
130 tests/test-hg-parseurl.py requires print_function
132 tests/test-hgweb-auth.py not using absolute_import
131 tests/test-hgweb-auth.py not using absolute_import
133 tests/test-hgweb-auth.py requires print_function
132 tests/test-hgweb-auth.py requires print_function
134 tests/test-hgwebdir-paths.py not using absolute_import
133 tests/test-hgwebdir-paths.py not using absolute_import
135 tests/test-hybridencode.py not using absolute_import
134 tests/test-hybridencode.py not using absolute_import
136 tests/test-hybridencode.py requires print_function
135 tests/test-hybridencode.py requires print_function
137 tests/test-lrucachedict.py not using absolute_import
136 tests/test-lrucachedict.py not using absolute_import
138 tests/test-lrucachedict.py requires print_function
137 tests/test-lrucachedict.py requires print_function
139 tests/test-manifest.py not using absolute_import
138 tests/test-manifest.py not using absolute_import
140 tests/test-minirst.py not using absolute_import
139 tests/test-minirst.py not using absolute_import
141 tests/test-minirst.py requires print_function
140 tests/test-minirst.py requires print_function
142 tests/test-parseindex2.py not using absolute_import
141 tests/test-parseindex2.py not using absolute_import
143 tests/test-parseindex2.py requires print_function
142 tests/test-parseindex2.py requires print_function
144 tests/test-pathencode.py not using absolute_import
143 tests/test-pathencode.py not using absolute_import
145 tests/test-pathencode.py requires print_function
144 tests/test-pathencode.py requires print_function
146 tests/test-propertycache.py not using absolute_import
145 tests/test-propertycache.py not using absolute_import
147 tests/test-propertycache.py requires print_function
146 tests/test-propertycache.py requires print_function
148 tests/test-revlog-ancestry.py not using absolute_import
147 tests/test-revlog-ancestry.py not using absolute_import
149 tests/test-revlog-ancestry.py requires print_function
148 tests/test-revlog-ancestry.py requires print_function
150 tests/test-run-tests.py not using absolute_import
149 tests/test-run-tests.py not using absolute_import
151 tests/test-simplemerge.py not using absolute_import
150 tests/test-simplemerge.py not using absolute_import
152 tests/test-status-inprocess.py not using absolute_import
151 tests/test-status-inprocess.py not using absolute_import
153 tests/test-status-inprocess.py requires print_function
152 tests/test-status-inprocess.py requires print_function
154 tests/test-symlink-os-yes-fs-no.py not using absolute_import
153 tests/test-symlink-os-yes-fs-no.py not using absolute_import
155 tests/test-trusted.py not using absolute_import
154 tests/test-trusted.py not using absolute_import
156 tests/test-trusted.py requires print_function
155 tests/test-trusted.py requires print_function
157 tests/test-ui-color.py not using absolute_import
156 tests/test-ui-color.py not using absolute_import
158 tests/test-ui-color.py requires print_function
157 tests/test-ui-color.py requires print_function
159 tests/test-ui-config.py not using absolute_import
158 tests/test-ui-config.py not using absolute_import
160 tests/test-ui-config.py requires print_function
159 tests/test-ui-config.py requires print_function
161 tests/test-ui-verbosity.py not using absolute_import
160 tests/test-ui-verbosity.py not using absolute_import
162 tests/test-ui-verbosity.py requires print_function
161 tests/test-ui-verbosity.py requires print_function
163 tests/test-url.py not using absolute_import
162 tests/test-url.py not using absolute_import
164 tests/test-url.py requires print_function
163 tests/test-url.py requires print_function
165 tests/test-walkrepo.py requires print_function
164 tests/test-walkrepo.py requires print_function
166 tests/test-wireproto.py requires print_function
165 tests/test-wireproto.py requires print_function
167 tests/tinyproxy.py requires print_function
166 tests/tinyproxy.py requires print_function
General Comments 0
You need to be logged in to leave comments. Login now