comparison mercurial/util.py @ 31495:d1937bdcee8c

util: use pycompat.bytestr in checkwinfilename Fixes `hg add` on python3.
author Augie Fackler <augie@google.com>
date Sun, 19 Mar 2017 00:16:08 -0400
parents cad95575dc46
children 670166e0fcaa
comparison
equal deleted inserted replaced
31494:faf75a701aca 31495:d1937bdcee8c
1175 if '\\/' in path: 1175 if '\\/' in path:
1176 return _("directory name ends with '\\', which is invalid on Windows") 1176 return _("directory name ends with '\\', which is invalid on Windows")
1177 for n in path.replace('\\', '/').split('/'): 1177 for n in path.replace('\\', '/').split('/'):
1178 if not n: 1178 if not n:
1179 continue 1179 continue
1180 for c in n: 1180 for c in pycompat.bytestr(n):
1181 if c in _winreservedchars: 1181 if c in _winreservedchars:
1182 return _("filename contains '%s', which is reserved " 1182 return _("filename contains '%s', which is reserved "
1183 "on Windows") % c 1183 "on Windows") % c
1184 if ord(c) <= 31: 1184 if ord(c) <= 31:
1185 return _("filename contains %r, which is invalid " 1185 return _("filename contains %r, which is invalid "