##// END OF EJS Templates
py3: conditionalize _winreg import...
Pulkit Goyal -
r29760:3df9f780 default
parent child Browse files
Show More
@@ -1,48 +1,53 b''
1 from __future__ import absolute_import
1 from __future__ import absolute_import
2
2
3 import _winreg
4 import os
3 import os
5
4
6 from . import (
5 from . import (
7 osutil,
6 osutil,
8 util,
7 util,
9 )
8 )
10
9
10 try:
11 import _winreg as winreg
12 winreg.CloseKey
13 except ImportError:
14 import winreg
15
11 def systemrcpath():
16 def systemrcpath():
12 '''return default os-specific hgrc search path'''
17 '''return default os-specific hgrc search path'''
13 rcpath = []
18 rcpath = []
14 filename = util.executablepath()
19 filename = util.executablepath()
15 # Use mercurial.ini found in directory with hg.exe
20 # Use mercurial.ini found in directory with hg.exe
16 progrc = os.path.join(os.path.dirname(filename), 'mercurial.ini')
21 progrc = os.path.join(os.path.dirname(filename), 'mercurial.ini')
17 rcpath.append(progrc)
22 rcpath.append(progrc)
18 # Use hgrc.d found in directory with hg.exe
23 # Use hgrc.d found in directory with hg.exe
19 progrcd = os.path.join(os.path.dirname(filename), 'hgrc.d')
24 progrcd = os.path.join(os.path.dirname(filename), 'hgrc.d')
20 if os.path.isdir(progrcd):
25 if os.path.isdir(progrcd):
21 for f, kind in osutil.listdir(progrcd):
26 for f, kind in osutil.listdir(progrcd):
22 if f.endswith('.rc'):
27 if f.endswith('.rc'):
23 rcpath.append(os.path.join(progrcd, f))
28 rcpath.append(os.path.join(progrcd, f))
24 # else look for a system rcpath in the registry
29 # else look for a system rcpath in the registry
25 value = util.lookupreg('SOFTWARE\\Mercurial', None,
30 value = util.lookupreg('SOFTWARE\\Mercurial', None,
26 _winreg.HKEY_LOCAL_MACHINE)
31 winreg.HKEY_LOCAL_MACHINE)
27 if not isinstance(value, str) or not value:
32 if not isinstance(value, str) or not value:
28 return rcpath
33 return rcpath
29 value = util.localpath(value)
34 value = util.localpath(value)
30 for p in value.split(os.pathsep):
35 for p in value.split(os.pathsep):
31 if p.lower().endswith('mercurial.ini'):
36 if p.lower().endswith('mercurial.ini'):
32 rcpath.append(p)
37 rcpath.append(p)
33 elif os.path.isdir(p):
38 elif os.path.isdir(p):
34 for f, kind in osutil.listdir(p):
39 for f, kind in osutil.listdir(p):
35 if f.endswith('.rc'):
40 if f.endswith('.rc'):
36 rcpath.append(os.path.join(p, f))
41 rcpath.append(os.path.join(p, f))
37 return rcpath
42 return rcpath
38
43
39 def userrcpath():
44 def userrcpath():
40 '''return os-specific hgrc search path to the user dir'''
45 '''return os-specific hgrc search path to the user dir'''
41 home = os.path.expanduser('~')
46 home = os.path.expanduser('~')
42 path = [os.path.join(home, 'mercurial.ini'),
47 path = [os.path.join(home, 'mercurial.ini'),
43 os.path.join(home, '.hgrc')]
48 os.path.join(home, '.hgrc')]
44 userprofile = os.environ.get('USERPROFILE')
49 userprofile = os.environ.get('USERPROFILE')
45 if userprofile and userprofile != home:
50 if userprofile and userprofile != home:
46 path.append(os.path.join(userprofile, 'mercurial.ini'))
51 path.append(os.path.join(userprofile, 'mercurial.ini'))
47 path.append(os.path.join(userprofile, '.hgrc'))
52 path.append(os.path.join(userprofile, '.hgrc'))
48 return path
53 return path
@@ -1,476 +1,481 b''
1 # windows.py - Windows utility function implementations for Mercurial
1 # windows.py - Windows utility function implementations for Mercurial
2 #
2 #
3 # Copyright 2005-2009 Matt Mackall <mpm@selenic.com> and others
3 # Copyright 2005-2009 Matt Mackall <mpm@selenic.com> and others
4 #
4 #
5 # This software may be used and distributed according to the terms of the
5 # This software may be used and distributed according to the terms of the
6 # GNU General Public License version 2 or any later version.
6 # GNU General Public License version 2 or any later version.
7
7
8 from __future__ import absolute_import
8 from __future__ import absolute_import
9
9
10 import _winreg
11 import errno
10 import errno
12 import msvcrt
11 import msvcrt
13 import os
12 import os
14 import re
13 import re
15 import stat
14 import stat
16 import sys
15 import sys
17
16
18 from .i18n import _
17 from .i18n import _
19 from . import (
18 from . import (
20 encoding,
19 encoding,
21 osutil,
20 osutil,
22 win32,
21 win32,
23 )
22 )
24
23
24 try:
25 import _winreg as winreg
26 winreg.CloseKey
27 except ImportError:
28 import winreg
29
25 executablepath = win32.executablepath
30 executablepath = win32.executablepath
26 getuser = win32.getuser
31 getuser = win32.getuser
27 hidewindow = win32.hidewindow
32 hidewindow = win32.hidewindow
28 makedir = win32.makedir
33 makedir = win32.makedir
29 nlinks = win32.nlinks
34 nlinks = win32.nlinks
30 oslink = win32.oslink
35 oslink = win32.oslink
31 samedevice = win32.samedevice
36 samedevice = win32.samedevice
32 samefile = win32.samefile
37 samefile = win32.samefile
33 setsignalhandler = win32.setsignalhandler
38 setsignalhandler = win32.setsignalhandler
34 spawndetached = win32.spawndetached
39 spawndetached = win32.spawndetached
35 split = os.path.split
40 split = os.path.split
36 termwidth = win32.termwidth
41 termwidth = win32.termwidth
37 testpid = win32.testpid
42 testpid = win32.testpid
38 unlink = win32.unlink
43 unlink = win32.unlink
39
44
40 umask = 0o022
45 umask = 0o022
41
46
42 class mixedfilemodewrapper(object):
47 class mixedfilemodewrapper(object):
43 """Wraps a file handle when it is opened in read/write mode.
48 """Wraps a file handle when it is opened in read/write mode.
44
49
45 fopen() and fdopen() on Windows have a specific-to-Windows requirement
50 fopen() and fdopen() on Windows have a specific-to-Windows requirement
46 that files opened with mode r+, w+, or a+ make a call to a file positioning
51 that files opened with mode r+, w+, or a+ make a call to a file positioning
47 function when switching between reads and writes. Without this extra call,
52 function when switching between reads and writes. Without this extra call,
48 Python will raise a not very intuitive "IOError: [Errno 0] Error."
53 Python will raise a not very intuitive "IOError: [Errno 0] Error."
49
54
50 This class wraps posixfile instances when the file is opened in read/write
55 This class wraps posixfile instances when the file is opened in read/write
51 mode and automatically adds checks or inserts appropriate file positioning
56 mode and automatically adds checks or inserts appropriate file positioning
52 calls when necessary.
57 calls when necessary.
53 """
58 """
54 OPNONE = 0
59 OPNONE = 0
55 OPREAD = 1
60 OPREAD = 1
56 OPWRITE = 2
61 OPWRITE = 2
57
62
58 def __init__(self, fp):
63 def __init__(self, fp):
59 object.__setattr__(self, '_fp', fp)
64 object.__setattr__(self, '_fp', fp)
60 object.__setattr__(self, '_lastop', 0)
65 object.__setattr__(self, '_lastop', 0)
61
66
62 def __getattr__(self, name):
67 def __getattr__(self, name):
63 return getattr(self._fp, name)
68 return getattr(self._fp, name)
64
69
65 def __setattr__(self, name, value):
70 def __setattr__(self, name, value):
66 return self._fp.__setattr__(name, value)
71 return self._fp.__setattr__(name, value)
67
72
68 def _noopseek(self):
73 def _noopseek(self):
69 self._fp.seek(0, os.SEEK_CUR)
74 self._fp.seek(0, os.SEEK_CUR)
70
75
71 def seek(self, *args, **kwargs):
76 def seek(self, *args, **kwargs):
72 object.__setattr__(self, '_lastop', self.OPNONE)
77 object.__setattr__(self, '_lastop', self.OPNONE)
73 return self._fp.seek(*args, **kwargs)
78 return self._fp.seek(*args, **kwargs)
74
79
75 def write(self, d):
80 def write(self, d):
76 if self._lastop == self.OPREAD:
81 if self._lastop == self.OPREAD:
77 self._noopseek()
82 self._noopseek()
78
83
79 object.__setattr__(self, '_lastop', self.OPWRITE)
84 object.__setattr__(self, '_lastop', self.OPWRITE)
80 return self._fp.write(d)
85 return self._fp.write(d)
81
86
82 def writelines(self, *args, **kwargs):
87 def writelines(self, *args, **kwargs):
83 if self._lastop == self.OPREAD:
88 if self._lastop == self.OPREAD:
84 self._noopeseek()
89 self._noopeseek()
85
90
86 object.__setattr__(self, '_lastop', self.OPWRITE)
91 object.__setattr__(self, '_lastop', self.OPWRITE)
87 return self._fp.writelines(*args, **kwargs)
92 return self._fp.writelines(*args, **kwargs)
88
93
89 def read(self, *args, **kwargs):
94 def read(self, *args, **kwargs):
90 if self._lastop == self.OPWRITE:
95 if self._lastop == self.OPWRITE:
91 self._noopseek()
96 self._noopseek()
92
97
93 object.__setattr__(self, '_lastop', self.OPREAD)
98 object.__setattr__(self, '_lastop', self.OPREAD)
94 return self._fp.read(*args, **kwargs)
99 return self._fp.read(*args, **kwargs)
95
100
96 def readline(self, *args, **kwargs):
101 def readline(self, *args, **kwargs):
97 if self._lastop == self.OPWRITE:
102 if self._lastop == self.OPWRITE:
98 self._noopseek()
103 self._noopseek()
99
104
100 object.__setattr__(self, '_lastop', self.OPREAD)
105 object.__setattr__(self, '_lastop', self.OPREAD)
101 return self._fp.readline(*args, **kwargs)
106 return self._fp.readline(*args, **kwargs)
102
107
103 def readlines(self, *args, **kwargs):
108 def readlines(self, *args, **kwargs):
104 if self._lastop == self.OPWRITE:
109 if self._lastop == self.OPWRITE:
105 self._noopseek()
110 self._noopseek()
106
111
107 object.__setattr__(self, '_lastop', self.OPREAD)
112 object.__setattr__(self, '_lastop', self.OPREAD)
108 return self._fp.readlines(*args, **kwargs)
113 return self._fp.readlines(*args, **kwargs)
109
114
110 def posixfile(name, mode='r', buffering=-1):
115 def posixfile(name, mode='r', buffering=-1):
111 '''Open a file with even more POSIX-like semantics'''
116 '''Open a file with even more POSIX-like semantics'''
112 try:
117 try:
113 fp = osutil.posixfile(name, mode, buffering) # may raise WindowsError
118 fp = osutil.posixfile(name, mode, buffering) # may raise WindowsError
114
119
115 # The position when opening in append mode is implementation defined, so
120 # The position when opening in append mode is implementation defined, so
116 # make it consistent with other platforms, which position at EOF.
121 # make it consistent with other platforms, which position at EOF.
117 if 'a' in mode:
122 if 'a' in mode:
118 fp.seek(0, os.SEEK_END)
123 fp.seek(0, os.SEEK_END)
119
124
120 if '+' in mode:
125 if '+' in mode:
121 return mixedfilemodewrapper(fp)
126 return mixedfilemodewrapper(fp)
122
127
123 return fp
128 return fp
124 except WindowsError as err:
129 except WindowsError as err:
125 # convert to a friendlier exception
130 # convert to a friendlier exception
126 raise IOError(err.errno, '%s: %s' % (name, err.strerror))
131 raise IOError(err.errno, '%s: %s' % (name, err.strerror))
127
132
128 class winstdout(object):
133 class winstdout(object):
129 '''stdout on windows misbehaves if sent through a pipe'''
134 '''stdout on windows misbehaves if sent through a pipe'''
130
135
131 def __init__(self, fp):
136 def __init__(self, fp):
132 self.fp = fp
137 self.fp = fp
133
138
134 def __getattr__(self, key):
139 def __getattr__(self, key):
135 return getattr(self.fp, key)
140 return getattr(self.fp, key)
136
141
137 def close(self):
142 def close(self):
138 try:
143 try:
139 self.fp.close()
144 self.fp.close()
140 except IOError:
145 except IOError:
141 pass
146 pass
142
147
143 def write(self, s):
148 def write(self, s):
144 try:
149 try:
145 # This is workaround for "Not enough space" error on
150 # This is workaround for "Not enough space" error on
146 # writing large size of data to console.
151 # writing large size of data to console.
147 limit = 16000
152 limit = 16000
148 l = len(s)
153 l = len(s)
149 start = 0
154 start = 0
150 self.softspace = 0
155 self.softspace = 0
151 while start < l:
156 while start < l:
152 end = start + limit
157 end = start + limit
153 self.fp.write(s[start:end])
158 self.fp.write(s[start:end])
154 start = end
159 start = end
155 except IOError as inst:
160 except IOError as inst:
156 if inst.errno != 0:
161 if inst.errno != 0:
157 raise
162 raise
158 self.close()
163 self.close()
159 raise IOError(errno.EPIPE, 'Broken pipe')
164 raise IOError(errno.EPIPE, 'Broken pipe')
160
165
161 def flush(self):
166 def flush(self):
162 try:
167 try:
163 return self.fp.flush()
168 return self.fp.flush()
164 except IOError as inst:
169 except IOError as inst:
165 if inst.errno != errno.EINVAL:
170 if inst.errno != errno.EINVAL:
166 raise
171 raise
167 self.close()
172 self.close()
168 raise IOError(errno.EPIPE, 'Broken pipe')
173 raise IOError(errno.EPIPE, 'Broken pipe')
169
174
170 sys.__stdout__ = sys.stdout = winstdout(sys.stdout)
175 sys.__stdout__ = sys.stdout = winstdout(sys.stdout)
171
176
172 def _is_win_9x():
177 def _is_win_9x():
173 '''return true if run on windows 95, 98 or me.'''
178 '''return true if run on windows 95, 98 or me.'''
174 try:
179 try:
175 return sys.getwindowsversion()[3] == 1
180 return sys.getwindowsversion()[3] == 1
176 except AttributeError:
181 except AttributeError:
177 return 'command' in os.environ.get('comspec', '')
182 return 'command' in os.environ.get('comspec', '')
178
183
179 def openhardlinks():
184 def openhardlinks():
180 return not _is_win_9x()
185 return not _is_win_9x()
181
186
182 def parsepatchoutput(output_line):
187 def parsepatchoutput(output_line):
183 """parses the output produced by patch and returns the filename"""
188 """parses the output produced by patch and returns the filename"""
184 pf = output_line[14:]
189 pf = output_line[14:]
185 if pf[0] == '`':
190 if pf[0] == '`':
186 pf = pf[1:-1] # Remove the quotes
191 pf = pf[1:-1] # Remove the quotes
187 return pf
192 return pf
188
193
189 def sshargs(sshcmd, host, user, port):
194 def sshargs(sshcmd, host, user, port):
190 '''Build argument list for ssh or Plink'''
195 '''Build argument list for ssh or Plink'''
191 pflag = 'plink' in sshcmd.lower() and '-P' or '-p'
196 pflag = 'plink' in sshcmd.lower() and '-P' or '-p'
192 args = user and ("%s@%s" % (user, host)) or host
197 args = user and ("%s@%s" % (user, host)) or host
193 return port and ("%s %s %s" % (args, pflag, port)) or args
198 return port and ("%s %s %s" % (args, pflag, port)) or args
194
199
195 def setflags(f, l, x):
200 def setflags(f, l, x):
196 pass
201 pass
197
202
198 def copymode(src, dst, mode=None):
203 def copymode(src, dst, mode=None):
199 pass
204 pass
200
205
201 def checkexec(path):
206 def checkexec(path):
202 return False
207 return False
203
208
204 def checklink(path):
209 def checklink(path):
205 return False
210 return False
206
211
207 def setbinary(fd):
212 def setbinary(fd):
208 # When run without console, pipes may expose invalid
213 # When run without console, pipes may expose invalid
209 # fileno(), usually set to -1.
214 # fileno(), usually set to -1.
210 fno = getattr(fd, 'fileno', None)
215 fno = getattr(fd, 'fileno', None)
211 if fno is not None and fno() >= 0:
216 if fno is not None and fno() >= 0:
212 msvcrt.setmode(fno(), os.O_BINARY)
217 msvcrt.setmode(fno(), os.O_BINARY)
213
218
214 def pconvert(path):
219 def pconvert(path):
215 return path.replace(os.sep, '/')
220 return path.replace(os.sep, '/')
216
221
217 def localpath(path):
222 def localpath(path):
218 return path.replace('/', '\\')
223 return path.replace('/', '\\')
219
224
220 def normpath(path):
225 def normpath(path):
221 return pconvert(os.path.normpath(path))
226 return pconvert(os.path.normpath(path))
222
227
223 def normcase(path):
228 def normcase(path):
224 return encoding.upper(path) # NTFS compares via upper()
229 return encoding.upper(path) # NTFS compares via upper()
225
230
226 # see posix.py for definitions
231 # see posix.py for definitions
227 normcasespec = encoding.normcasespecs.upper
232 normcasespec = encoding.normcasespecs.upper
228 normcasefallback = encoding.upperfallback
233 normcasefallback = encoding.upperfallback
229
234
230 def samestat(s1, s2):
235 def samestat(s1, s2):
231 return False
236 return False
232
237
233 # A sequence of backslashes is special iff it precedes a double quote:
238 # A sequence of backslashes is special iff it precedes a double quote:
234 # - if there's an even number of backslashes, the double quote is not
239 # - if there's an even number of backslashes, the double quote is not
235 # quoted (i.e. it ends the quoted region)
240 # quoted (i.e. it ends the quoted region)
236 # - if there's an odd number of backslashes, the double quote is quoted
241 # - if there's an odd number of backslashes, the double quote is quoted
237 # - in both cases, every pair of backslashes is unquoted into a single
242 # - in both cases, every pair of backslashes is unquoted into a single
238 # backslash
243 # backslash
239 # (See http://msdn2.microsoft.com/en-us/library/a1y7w461.aspx )
244 # (See http://msdn2.microsoft.com/en-us/library/a1y7w461.aspx )
240 # So, to quote a string, we must surround it in double quotes, double
245 # So, to quote a string, we must surround it in double quotes, double
241 # the number of backslashes that precede double quotes and add another
246 # the number of backslashes that precede double quotes and add another
242 # backslash before every double quote (being careful with the double
247 # backslash before every double quote (being careful with the double
243 # quote we've appended to the end)
248 # quote we've appended to the end)
244 _quotere = None
249 _quotere = None
245 _needsshellquote = None
250 _needsshellquote = None
246 def shellquote(s):
251 def shellquote(s):
247 r"""
252 r"""
248 >>> shellquote(r'C:\Users\xyz')
253 >>> shellquote(r'C:\Users\xyz')
249 '"C:\\Users\\xyz"'
254 '"C:\\Users\\xyz"'
250 >>> shellquote(r'C:\Users\xyz/mixed')
255 >>> shellquote(r'C:\Users\xyz/mixed')
251 '"C:\\Users\\xyz/mixed"'
256 '"C:\\Users\\xyz/mixed"'
252 >>> # Would be safe not to quote too, since it is all double backslashes
257 >>> # Would be safe not to quote too, since it is all double backslashes
253 >>> shellquote(r'C:\\Users\\xyz')
258 >>> shellquote(r'C:\\Users\\xyz')
254 '"C:\\\\Users\\\\xyz"'
259 '"C:\\\\Users\\\\xyz"'
255 >>> # But this must be quoted
260 >>> # But this must be quoted
256 >>> shellquote(r'C:\\Users\\xyz/abc')
261 >>> shellquote(r'C:\\Users\\xyz/abc')
257 '"C:\\\\Users\\\\xyz/abc"'
262 '"C:\\\\Users\\\\xyz/abc"'
258 """
263 """
259 global _quotere
264 global _quotere
260 if _quotere is None:
265 if _quotere is None:
261 _quotere = re.compile(r'(\\*)("|\\$)')
266 _quotere = re.compile(r'(\\*)("|\\$)')
262 global _needsshellquote
267 global _needsshellquote
263 if _needsshellquote is None:
268 if _needsshellquote is None:
264 # ":" is also treated as "safe character", because it is used as a part
269 # ":" is also treated as "safe character", because it is used as a part
265 # of path name on Windows. "\" is also part of a path name, but isn't
270 # of path name on Windows. "\" is also part of a path name, but isn't
266 # safe because shlex.split() (kind of) treats it as an escape char and
271 # safe because shlex.split() (kind of) treats it as an escape char and
267 # drops it. It will leave the next character, even if it is another
272 # drops it. It will leave the next character, even if it is another
268 # "\".
273 # "\".
269 _needsshellquote = re.compile(r'[^a-zA-Z0-9._:/-]').search
274 _needsshellquote = re.compile(r'[^a-zA-Z0-9._:/-]').search
270 if s and not _needsshellquote(s) and not _quotere.search(s):
275 if s and not _needsshellquote(s) and not _quotere.search(s):
271 # "s" shouldn't have to be quoted
276 # "s" shouldn't have to be quoted
272 return s
277 return s
273 return '"%s"' % _quotere.sub(r'\1\1\\\2', s)
278 return '"%s"' % _quotere.sub(r'\1\1\\\2', s)
274
279
275 def quotecommand(cmd):
280 def quotecommand(cmd):
276 """Build a command string suitable for os.popen* calls."""
281 """Build a command string suitable for os.popen* calls."""
277 if sys.version_info < (2, 7, 1):
282 if sys.version_info < (2, 7, 1):
278 # Python versions since 2.7.1 do this extra quoting themselves
283 # Python versions since 2.7.1 do this extra quoting themselves
279 return '"' + cmd + '"'
284 return '"' + cmd + '"'
280 return cmd
285 return cmd
281
286
282 def popen(command, mode='r'):
287 def popen(command, mode='r'):
283 # Work around "popen spawned process may not write to stdout
288 # Work around "popen spawned process may not write to stdout
284 # under windows"
289 # under windows"
285 # http://bugs.python.org/issue1366
290 # http://bugs.python.org/issue1366
286 command += " 2> %s" % os.devnull
291 command += " 2> %s" % os.devnull
287 return os.popen(quotecommand(command), mode)
292 return os.popen(quotecommand(command), mode)
288
293
289 def explainexit(code):
294 def explainexit(code):
290 return _("exited with status %d") % code, code
295 return _("exited with status %d") % code, code
291
296
292 # if you change this stub into a real check, please try to implement the
297 # if you change this stub into a real check, please try to implement the
293 # username and groupname functions above, too.
298 # username and groupname functions above, too.
294 def isowner(st):
299 def isowner(st):
295 return True
300 return True
296
301
297 def findexe(command):
302 def findexe(command):
298 '''Find executable for command searching like cmd.exe does.
303 '''Find executable for command searching like cmd.exe does.
299 If command is a basename then PATH is searched for command.
304 If command is a basename then PATH is searched for command.
300 PATH isn't searched if command is an absolute or relative path.
305 PATH isn't searched if command is an absolute or relative path.
301 An extension from PATHEXT is found and added if not present.
306 An extension from PATHEXT is found and added if not present.
302 If command isn't found None is returned.'''
307 If command isn't found None is returned.'''
303 pathext = os.environ.get('PATHEXT', '.COM;.EXE;.BAT;.CMD')
308 pathext = os.environ.get('PATHEXT', '.COM;.EXE;.BAT;.CMD')
304 pathexts = [ext for ext in pathext.lower().split(os.pathsep)]
309 pathexts = [ext for ext in pathext.lower().split(os.pathsep)]
305 if os.path.splitext(command)[1].lower() in pathexts:
310 if os.path.splitext(command)[1].lower() in pathexts:
306 pathexts = ['']
311 pathexts = ['']
307
312
308 def findexisting(pathcommand):
313 def findexisting(pathcommand):
309 'Will append extension (if needed) and return existing file'
314 'Will append extension (if needed) and return existing file'
310 for ext in pathexts:
315 for ext in pathexts:
311 executable = pathcommand + ext
316 executable = pathcommand + ext
312 if os.path.exists(executable):
317 if os.path.exists(executable):
313 return executable
318 return executable
314 return None
319 return None
315
320
316 if os.sep in command:
321 if os.sep in command:
317 return findexisting(command)
322 return findexisting(command)
318
323
319 for path in os.environ.get('PATH', '').split(os.pathsep):
324 for path in os.environ.get('PATH', '').split(os.pathsep):
320 executable = findexisting(os.path.join(path, command))
325 executable = findexisting(os.path.join(path, command))
321 if executable is not None:
326 if executable is not None:
322 return executable
327 return executable
323 return findexisting(os.path.expanduser(os.path.expandvars(command)))
328 return findexisting(os.path.expanduser(os.path.expandvars(command)))
324
329
325 _wantedkinds = set([stat.S_IFREG, stat.S_IFLNK])
330 _wantedkinds = set([stat.S_IFREG, stat.S_IFLNK])
326
331
327 def statfiles(files):
332 def statfiles(files):
328 '''Stat each file in files. Yield each stat, or None if a file
333 '''Stat each file in files. Yield each stat, or None if a file
329 does not exist or has a type we don't care about.
334 does not exist or has a type we don't care about.
330
335
331 Cluster and cache stat per directory to minimize number of OS stat calls.'''
336 Cluster and cache stat per directory to minimize number of OS stat calls.'''
332 dircache = {} # dirname -> filename -> status | None if file does not exist
337 dircache = {} # dirname -> filename -> status | None if file does not exist
333 getkind = stat.S_IFMT
338 getkind = stat.S_IFMT
334 for nf in files:
339 for nf in files:
335 nf = normcase(nf)
340 nf = normcase(nf)
336 dir, base = os.path.split(nf)
341 dir, base = os.path.split(nf)
337 if not dir:
342 if not dir:
338 dir = '.'
343 dir = '.'
339 cache = dircache.get(dir, None)
344 cache = dircache.get(dir, None)
340 if cache is None:
345 if cache is None:
341 try:
346 try:
342 dmap = dict([(normcase(n), s)
347 dmap = dict([(normcase(n), s)
343 for n, k, s in osutil.listdir(dir, True)
348 for n, k, s in osutil.listdir(dir, True)
344 if getkind(s.st_mode) in _wantedkinds])
349 if getkind(s.st_mode) in _wantedkinds])
345 except OSError as err:
350 except OSError as err:
346 # Python >= 2.5 returns ENOENT and adds winerror field
351 # Python >= 2.5 returns ENOENT and adds winerror field
347 # EINVAL is raised if dir is not a directory.
352 # EINVAL is raised if dir is not a directory.
348 if err.errno not in (errno.ENOENT, errno.EINVAL,
353 if err.errno not in (errno.ENOENT, errno.EINVAL,
349 errno.ENOTDIR):
354 errno.ENOTDIR):
350 raise
355 raise
351 dmap = {}
356 dmap = {}
352 cache = dircache.setdefault(dir, dmap)
357 cache = dircache.setdefault(dir, dmap)
353 yield cache.get(base, None)
358 yield cache.get(base, None)
354
359
355 def username(uid=None):
360 def username(uid=None):
356 """Return the name of the user with the given uid.
361 """Return the name of the user with the given uid.
357
362
358 If uid is None, return the name of the current user."""
363 If uid is None, return the name of the current user."""
359 return None
364 return None
360
365
361 def groupname(gid=None):
366 def groupname(gid=None):
362 """Return the name of the group with the given gid.
367 """Return the name of the group with the given gid.
363
368
364 If gid is None, return the name of the current group."""
369 If gid is None, return the name of the current group."""
365 return None
370 return None
366
371
367 def removedirs(name):
372 def removedirs(name):
368 """special version of os.removedirs that does not remove symlinked
373 """special version of os.removedirs that does not remove symlinked
369 directories or junction points if they actually contain files"""
374 directories or junction points if they actually contain files"""
370 if osutil.listdir(name):
375 if osutil.listdir(name):
371 return
376 return
372 os.rmdir(name)
377 os.rmdir(name)
373 head, tail = os.path.split(name)
378 head, tail = os.path.split(name)
374 if not tail:
379 if not tail:
375 head, tail = os.path.split(head)
380 head, tail = os.path.split(head)
376 while head and tail:
381 while head and tail:
377 try:
382 try:
378 if osutil.listdir(head):
383 if osutil.listdir(head):
379 return
384 return
380 os.rmdir(head)
385 os.rmdir(head)
381 except (ValueError, OSError):
386 except (ValueError, OSError):
382 break
387 break
383 head, tail = os.path.split(head)
388 head, tail = os.path.split(head)
384
389
385 def unlinkpath(f, ignoremissing=False):
390 def unlinkpath(f, ignoremissing=False):
386 """unlink and remove the directory if it is empty"""
391 """unlink and remove the directory if it is empty"""
387 try:
392 try:
388 unlink(f)
393 unlink(f)
389 except OSError as e:
394 except OSError as e:
390 if not (ignoremissing and e.errno == errno.ENOENT):
395 if not (ignoremissing and e.errno == errno.ENOENT):
391 raise
396 raise
392 # try removing directories that might now be empty
397 # try removing directories that might now be empty
393 try:
398 try:
394 removedirs(os.path.dirname(f))
399 removedirs(os.path.dirname(f))
395 except OSError:
400 except OSError:
396 pass
401 pass
397
402
398 def rename(src, dst):
403 def rename(src, dst):
399 '''atomically rename file src to dst, replacing dst if it exists'''
404 '''atomically rename file src to dst, replacing dst if it exists'''
400 try:
405 try:
401 os.rename(src, dst)
406 os.rename(src, dst)
402 except OSError as e:
407 except OSError as e:
403 if e.errno != errno.EEXIST:
408 if e.errno != errno.EEXIST:
404 raise
409 raise
405 unlink(dst)
410 unlink(dst)
406 os.rename(src, dst)
411 os.rename(src, dst)
407
412
408 def gethgcmd():
413 def gethgcmd():
409 return [sys.executable] + sys.argv[:1]
414 return [sys.executable] + sys.argv[:1]
410
415
411 def groupmembers(name):
416 def groupmembers(name):
412 # Don't support groups on Windows for now
417 # Don't support groups on Windows for now
413 raise KeyError
418 raise KeyError
414
419
415 def isexec(f):
420 def isexec(f):
416 return False
421 return False
417
422
418 class cachestat(object):
423 class cachestat(object):
419 def __init__(self, path):
424 def __init__(self, path):
420 pass
425 pass
421
426
422 def cacheable(self):
427 def cacheable(self):
423 return False
428 return False
424
429
425 def lookupreg(key, valname=None, scope=None):
430 def lookupreg(key, valname=None, scope=None):
426 ''' Look up a key/value name in the Windows registry.
431 ''' Look up a key/value name in the Windows registry.
427
432
428 valname: value name. If unspecified, the default value for the key
433 valname: value name. If unspecified, the default value for the key
429 is used.
434 is used.
430 scope: optionally specify scope for registry lookup, this can be
435 scope: optionally specify scope for registry lookup, this can be
431 a sequence of scopes to look up in order. Default (CURRENT_USER,
436 a sequence of scopes to look up in order. Default (CURRENT_USER,
432 LOCAL_MACHINE).
437 LOCAL_MACHINE).
433 '''
438 '''
434 if scope is None:
439 if scope is None:
435 scope = (_winreg.HKEY_CURRENT_USER, _winreg.HKEY_LOCAL_MACHINE)
440 scope = (winreg.HKEY_CURRENT_USER, winreg.HKEY_LOCAL_MACHINE)
436 elif not isinstance(scope, (list, tuple)):
441 elif not isinstance(scope, (list, tuple)):
437 scope = (scope,)
442 scope = (scope,)
438 for s in scope:
443 for s in scope:
439 try:
444 try:
440 val = _winreg.QueryValueEx(_winreg.OpenKey(s, key), valname)[0]
445 val = winreg.QueryValueEx(winreg.OpenKey(s, key), valname)[0]
441 # never let a Unicode string escape into the wild
446 # never let a Unicode string escape into the wild
442 return encoding.tolocal(val.encode('UTF-8'))
447 return encoding.tolocal(val.encode('UTF-8'))
443 except EnvironmentError:
448 except EnvironmentError:
444 pass
449 pass
445
450
446 expandglobs = True
451 expandglobs = True
447
452
448 def statislink(st):
453 def statislink(st):
449 '''check whether a stat result is a symlink'''
454 '''check whether a stat result is a symlink'''
450 return False
455 return False
451
456
452 def statisexec(st):
457 def statisexec(st):
453 '''check whether a stat result is an executable file'''
458 '''check whether a stat result is an executable file'''
454 return False
459 return False
455
460
456 def poll(fds):
461 def poll(fds):
457 # see posix.py for description
462 # see posix.py for description
458 raise NotImplementedError()
463 raise NotImplementedError()
459
464
460 def readpipe(pipe):
465 def readpipe(pipe):
461 """Read all available data from a pipe."""
466 """Read all available data from a pipe."""
462 chunks = []
467 chunks = []
463 while True:
468 while True:
464 size = win32.peekpipe(pipe)
469 size = win32.peekpipe(pipe)
465 if not size:
470 if not size:
466 break
471 break
467
472
468 s = pipe.read(size)
473 s = pipe.read(size)
469 if not s:
474 if not s:
470 break
475 break
471 chunks.append(s)
476 chunks.append(s)
472
477
473 return ''.join(chunks)
478 return ''.join(chunks)
474
479
475 def bindunixsocket(sock, path):
480 def bindunixsocket(sock, path):
476 raise NotImplementedError('unsupported platform')
481 raise NotImplementedError('unsupported platform')
@@ -1,173 +1,173 b''
1 #require test-repo
1 #require test-repo
2
2
3 $ . "$TESTDIR/helpers-testrepo.sh"
3 $ . "$TESTDIR/helpers-testrepo.sh"
4 $ cd "$TESTDIR"/..
4 $ cd "$TESTDIR"/..
5
5
6 $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs python contrib/check-py3-compat.py
6 $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs python contrib/check-py3-compat.py
7 hgext/fsmonitor/pywatchman/__init__.py not using absolute_import
7 hgext/fsmonitor/pywatchman/__init__.py not using absolute_import
8 hgext/fsmonitor/pywatchman/__init__.py requires print_function
8 hgext/fsmonitor/pywatchman/__init__.py requires print_function
9 hgext/fsmonitor/pywatchman/capabilities.py not using absolute_import
9 hgext/fsmonitor/pywatchman/capabilities.py not using absolute_import
10 hgext/fsmonitor/pywatchman/pybser.py not using absolute_import
10 hgext/fsmonitor/pywatchman/pybser.py not using absolute_import
11 i18n/check-translation.py not using absolute_import
11 i18n/check-translation.py not using absolute_import
12 setup.py not using absolute_import
12 setup.py not using absolute_import
13 tests/test-demandimport.py not using absolute_import
13 tests/test-demandimport.py not using absolute_import
14
14
15 #if py3exe
15 #if py3exe
16 $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs $PYTHON3 contrib/check-py3-compat.py
16 $ hg files 'set:(**.py)' | sed 's|\\|/|g' | xargs $PYTHON3 contrib/check-py3-compat.py
17 doc/hgmanpage.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
17 doc/hgmanpage.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
18 hgext/acl.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
18 hgext/acl.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
19 hgext/automv.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
19 hgext/automv.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
20 hgext/blackbox.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
20 hgext/blackbox.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
21 hgext/bugzilla.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
21 hgext/bugzilla.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
22 hgext/censor.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
22 hgext/censor.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
23 hgext/chgserver.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
23 hgext/chgserver.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
24 hgext/children.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
24 hgext/children.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
25 hgext/churn.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
25 hgext/churn.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
26 hgext/clonebundles.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
26 hgext/clonebundles.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
27 hgext/color.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
27 hgext/color.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
28 hgext/convert/bzr.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
28 hgext/convert/bzr.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
29 hgext/convert/common.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
29 hgext/convert/common.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
30 hgext/convert/convcmd.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
30 hgext/convert/convcmd.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
31 hgext/convert/cvs.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
31 hgext/convert/cvs.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
32 hgext/convert/cvsps.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
32 hgext/convert/cvsps.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
33 hgext/convert/darcs.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
33 hgext/convert/darcs.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
34 hgext/convert/filemap.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
34 hgext/convert/filemap.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
35 hgext/convert/git.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
35 hgext/convert/git.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
36 hgext/convert/gnuarch.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
36 hgext/convert/gnuarch.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
37 hgext/convert/hg.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
37 hgext/convert/hg.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
38 hgext/convert/monotone.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
38 hgext/convert/monotone.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
39 hgext/convert/p4.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
39 hgext/convert/p4.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
40 hgext/convert/subversion.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
40 hgext/convert/subversion.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
41 hgext/convert/transport.py: error importing module: <ImportError> No module named 'svn.client' (line *) (glob)
41 hgext/convert/transport.py: error importing module: <ImportError> No module named 'svn.client' (line *) (glob)
42 hgext/eol.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
42 hgext/eol.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
43 hgext/extdiff.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
43 hgext/extdiff.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
44 hgext/factotum.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
44 hgext/factotum.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
45 hgext/fetch.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
45 hgext/fetch.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
46 hgext/fsmonitor/state.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
46 hgext/fsmonitor/state.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
47 hgext/fsmonitor/watchmanclient.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
47 hgext/fsmonitor/watchmanclient.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
48 hgext/gpg.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
48 hgext/gpg.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
49 hgext/graphlog.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
49 hgext/graphlog.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
50 hgext/hgk.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
50 hgext/hgk.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
51 hgext/highlight/highlight.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
51 hgext/highlight/highlight.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
52 hgext/histedit.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
52 hgext/histedit.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
53 hgext/journal.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
53 hgext/journal.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
54 hgext/keyword.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
54 hgext/keyword.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
55 hgext/largefiles/basestore.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
55 hgext/largefiles/basestore.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
56 hgext/largefiles/lfcommands.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
56 hgext/largefiles/lfcommands.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
57 hgext/largefiles/lfutil.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
57 hgext/largefiles/lfutil.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
58 hgext/largefiles/localstore.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
58 hgext/largefiles/localstore.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
59 hgext/largefiles/overrides.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
59 hgext/largefiles/overrides.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
60 hgext/largefiles/proto.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
60 hgext/largefiles/proto.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
61 hgext/largefiles/remotestore.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
61 hgext/largefiles/remotestore.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
62 hgext/largefiles/reposetup.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
62 hgext/largefiles/reposetup.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
63 hgext/largefiles/storefactory.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
63 hgext/largefiles/storefactory.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
64 hgext/largefiles/uisetup.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
64 hgext/largefiles/uisetup.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
65 hgext/largefiles/wirestore.py: error importing module: <SystemError> Parent module 'hgext.largefiles' not loaded, cannot perform relative import (line *) (glob)
65 hgext/largefiles/wirestore.py: error importing module: <SystemError> Parent module 'hgext.largefiles' not loaded, cannot perform relative import (line *) (glob)
66 hgext/mq.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
66 hgext/mq.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
67 hgext/notify.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
67 hgext/notify.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
68 hgext/pager.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
68 hgext/pager.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
69 hgext/patchbomb.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
69 hgext/patchbomb.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
70 hgext/purge.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
70 hgext/purge.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
71 hgext/rebase.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
71 hgext/rebase.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
72 hgext/record.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
72 hgext/record.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
73 hgext/relink.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
73 hgext/relink.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
74 hgext/schemes.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
74 hgext/schemes.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
75 hgext/share.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
75 hgext/share.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
76 hgext/shelve.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
76 hgext/shelve.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
77 hgext/strip.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
77 hgext/strip.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
78 hgext/transplant.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
78 hgext/transplant.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
79 hgext/win32mbcs.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
79 hgext/win32mbcs.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
80 hgext/win32text.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
80 hgext/win32text.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
81 mercurial/archival.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
81 mercurial/archival.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
82 mercurial/bookmarks.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
82 mercurial/bookmarks.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
83 mercurial/branchmap.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
83 mercurial/branchmap.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
84 mercurial/bundle2.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
84 mercurial/bundle2.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
85 mercurial/bundlerepo.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
85 mercurial/bundlerepo.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
86 mercurial/byterange.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
86 mercurial/byterange.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
87 mercurial/changegroup.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
87 mercurial/changegroup.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
88 mercurial/changelog.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
88 mercurial/changelog.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
89 mercurial/cmdutil.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
89 mercurial/cmdutil.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
90 mercurial/commands.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
90 mercurial/commands.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
91 mercurial/commandserver.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
91 mercurial/commandserver.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
92 mercurial/config.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
92 mercurial/config.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
93 mercurial/context.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
93 mercurial/context.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
94 mercurial/copies.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
94 mercurial/copies.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
95 mercurial/crecord.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
95 mercurial/crecord.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
96 mercurial/dagparser.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
96 mercurial/dagparser.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
97 mercurial/dagutil.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
97 mercurial/dagutil.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
98 mercurial/destutil.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
98 mercurial/destutil.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
99 mercurial/dirstate.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
99 mercurial/dirstate.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
100 mercurial/discovery.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
100 mercurial/discovery.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
101 mercurial/dispatch.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
101 mercurial/dispatch.py: error importing: <TypeError> str expected, not bytes (error at encoding.py:*) (glob)
102 mercurial/exchange.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*) (glob)
102 mercurial/exchange.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*) (glob)
103 mercurial/extensions.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*) (glob)
103 mercurial/extensions.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*) (glob)
104 mercurial/fancyopts.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*) (glob)
104 mercurial/fancyopts.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*) (glob)
105 mercurial/filelog.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*) (glob)
105 mercurial/filelog.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*) (glob)
106 mercurial/filemerge.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*) (glob)
106 mercurial/filemerge.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*) (glob)
107 mercurial/fileset.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*) (glob)
107 mercurial/fileset.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*) (glob)
108 mercurial/formatter.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*) (glob)
108 mercurial/formatter.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*) (glob)
109 mercurial/graphmod.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*) (glob)
109 mercurial/graphmod.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*) (glob)
110 mercurial/hbisect.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*) (glob)
110 mercurial/hbisect.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*) (glob)
111 mercurial/help.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*) (glob)
111 mercurial/help.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*) (glob)
112 mercurial/hg.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*) (glob)
112 mercurial/hg.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*) (glob)
113 mercurial/hgweb/common.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
113 mercurial/hgweb/common.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
114 mercurial/hgweb/hgweb_mod.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
114 mercurial/hgweb/hgweb_mod.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
115 mercurial/hgweb/hgwebdir_mod.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
115 mercurial/hgweb/hgwebdir_mod.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
116 mercurial/hgweb/protocol.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
116 mercurial/hgweb/protocol.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
117 mercurial/hgweb/request.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
117 mercurial/hgweb/request.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
118 mercurial/hgweb/server.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
118 mercurial/hgweb/server.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
119 mercurial/hgweb/webcommands.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
119 mercurial/hgweb/webcommands.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
120 mercurial/hgweb/webutil.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
120 mercurial/hgweb/webutil.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
121 mercurial/hgweb/wsgicgi.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
121 mercurial/hgweb/wsgicgi.py: error importing module: <SystemError> Parent module 'mercurial.hgweb' not loaded, cannot perform relative import (line *) (glob)
122 mercurial/hook.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*) (glob)
122 mercurial/hook.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*) (glob)
123 mercurial/httpconnection.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*) (glob)
123 mercurial/httpconnection.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*) (glob)
124 mercurial/httppeer.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*) (glob)
124 mercurial/httppeer.py: error importing: <TypeError> str expected, not bytes (error at i18n.py:*) (glob)
125 mercurial/keepalive.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
125 mercurial/keepalive.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
126 mercurial/localrepo.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
126 mercurial/localrepo.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
127 mercurial/lock.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
127 mercurial/lock.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
128 mercurial/mail.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
128 mercurial/mail.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
129 mercurial/manifest.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
129 mercurial/manifest.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
130 mercurial/match.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
130 mercurial/match.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
131 mercurial/mdiff.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
131 mercurial/mdiff.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
132 mercurial/merge.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
132 mercurial/merge.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
133 mercurial/minirst.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
133 mercurial/minirst.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
134 mercurial/namespaces.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
134 mercurial/namespaces.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
135 mercurial/obsolete.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
135 mercurial/obsolete.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
136 mercurial/patch.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
136 mercurial/patch.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
137 mercurial/pathutil.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
137 mercurial/pathutil.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
138 mercurial/peer.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
138 mercurial/peer.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
139 mercurial/pure/mpatch.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
139 mercurial/pure/mpatch.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
140 mercurial/pure/parsers.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
140 mercurial/pure/parsers.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
141 mercurial/pushkey.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
141 mercurial/pushkey.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
142 mercurial/pvec.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
142 mercurial/pvec.py: error importing: <TypeError> getattr(): attribute name must be string (error at pycompat.py:*) (glob)
143 mercurial/registrar.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
143 mercurial/registrar.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
144 mercurial/repair.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
144 mercurial/repair.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
145 mercurial/repoview.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
145 mercurial/repoview.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
146 mercurial/revlog.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
146 mercurial/revlog.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
147 mercurial/revset.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
147 mercurial/revset.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
148 mercurial/scmutil.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
148 mercurial/scmutil.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
149 mercurial/scmwindows.py: error importing module: <ImportError> No module named '_winreg' (line *) (glob)
149 mercurial/scmwindows.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
150 mercurial/similar.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
150 mercurial/similar.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
151 mercurial/simplemerge.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
151 mercurial/simplemerge.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
152 mercurial/sshpeer.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
152 mercurial/sshpeer.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
153 mercurial/sshserver.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
153 mercurial/sshserver.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
154 mercurial/sslutil.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
154 mercurial/sslutil.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
155 mercurial/statichttprepo.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
155 mercurial/statichttprepo.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
156 mercurial/store.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
156 mercurial/store.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
157 mercurial/streamclone.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
157 mercurial/streamclone.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
158 mercurial/subrepo.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
158 mercurial/subrepo.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
159 mercurial/tagmerge.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
159 mercurial/tagmerge.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
160 mercurial/tags.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
160 mercurial/tags.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
161 mercurial/templatefilters.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
161 mercurial/templatefilters.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
162 mercurial/templatekw.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
162 mercurial/templatekw.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
163 mercurial/templater.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
163 mercurial/templater.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
164 mercurial/transaction.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
164 mercurial/transaction.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
165 mercurial/ui.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
165 mercurial/ui.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
166 mercurial/unionrepo.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
166 mercurial/unionrepo.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
167 mercurial/url.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
167 mercurial/url.py: error importing: <TypeError> getattr(): attribute name must be string (error at util.py:*) (glob)
168 mercurial/verify.py: error importing: <TypeError> attribute name must be string, not 'bytes' (error at mdiff.py:*) (glob)
168 mercurial/verify.py: error importing: <TypeError> attribute name must be string, not 'bytes' (error at mdiff.py:*) (glob)
169 mercurial/win32.py: error importing module: <ImportError> No module named 'msvcrt' (line *) (glob)
169 mercurial/win32.py: error importing module: <ImportError> No module named 'msvcrt' (line *) (glob)
170 mercurial/windows.py: error importing module: <ImportError> No module named '_winreg' (line *) (glob)
170 mercurial/windows.py: error importing module: <ImportError> No module named 'msvcrt' (line *) (glob)
171 mercurial/wireproto.py: error importing module: <TypeError> a bytes-like object is required, not 'str' (line *) (glob)
171 mercurial/wireproto.py: error importing module: <TypeError> a bytes-like object is required, not 'str' (line *) (glob)
172
172
173 #endif
173 #endif
General Comments 0
You need to be logged in to leave comments. Login now