Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 34360:f435097d13c9
py3: manually escape control character to be embedded in win filename error
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 27 Sep 2017 19:11:28 +0900 |
parents | c41444a39de2 |
children | 7508a7dc95c1 |
comparison
equal
deleted
inserted
replaced
34359:ee10eb665036 | 34360:f435097d13c9 |
---|---|
1332 for c in _filenamebytestr(n): | 1332 for c in _filenamebytestr(n): |
1333 if c in _winreservedchars: | 1333 if c in _winreservedchars: |
1334 return _("filename contains '%s', which is reserved " | 1334 return _("filename contains '%s', which is reserved " |
1335 "on Windows") % c | 1335 "on Windows") % c |
1336 if ord(c) <= 31: | 1336 if ord(c) <= 31: |
1337 return _("filename contains %r, which is invalid " | 1337 return _("filename contains '%s', which is invalid " |
1338 "on Windows") % c | 1338 "on Windows") % escapestr(c) |
1339 base = n.split('.')[0] | 1339 base = n.split('.')[0] |
1340 if base and base.lower() in _winreservednames: | 1340 if base and base.lower() in _winreservednames: |
1341 return _("filename contains '%s', which is reserved " | 1341 return _("filename contains '%s', which is reserved " |
1342 "on Windows") % base | 1342 "on Windows") % base |
1343 t = n[-1] | 1343 t = n[-1] |