Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 32652:9929af2b09b4
merge with stable
author | Augie Fackler <augie@google.com> |
---|---|
date | Sat, 03 Jun 2017 16:33:28 -0400 |
parents | 3b8155305fbe 377c74ef008d |
children | 77f354ae1123 |
comparison
equal
deleted
inserted
replaced
32650:783394c0c978 | 32652:9929af2b09b4 |
---|---|
68 stdout = pycompat.stdout | 68 stdout = pycompat.stdout |
69 stringio = pycompat.stringio | 69 stringio = pycompat.stringio |
70 urlerr = pycompat.urlerr | 70 urlerr = pycompat.urlerr |
71 urlreq = pycompat.urlreq | 71 urlreq = pycompat.urlreq |
72 xmlrpclib = pycompat.xmlrpclib | 72 xmlrpclib = pycompat.xmlrpclib |
73 | |
74 # workaround for win32mbcs | |
75 _filenamebytestr = pycompat.bytestr | |
73 | 76 |
74 def isatty(fp): | 77 def isatty(fp): |
75 try: | 78 try: |
76 return fp.isatty() | 79 return fp.isatty() |
77 except AttributeError: | 80 except AttributeError: |
1206 if '\\/' in path: | 1209 if '\\/' in path: |
1207 return _("directory name ends with '\\', which is invalid on Windows") | 1210 return _("directory name ends with '\\', which is invalid on Windows") |
1208 for n in path.replace('\\', '/').split('/'): | 1211 for n in path.replace('\\', '/').split('/'): |
1209 if not n: | 1212 if not n: |
1210 continue | 1213 continue |
1211 for c in pycompat.bytestr(n): | 1214 for c in _filenamebytestr(n): |
1212 if c in _winreservedchars: | 1215 if c in _winreservedchars: |
1213 return _("filename contains '%s', which is reserved " | 1216 return _("filename contains '%s', which is reserved " |
1214 "on Windows") % c | 1217 "on Windows") % c |
1215 if ord(c) <= 31: | 1218 if ord(c) <= 31: |
1216 return _("filename contains %r, which is invalid " | 1219 return _("filename contains %r, which is invalid " |