[PATCH V2] util: rename _windows_reserved_filenames and _windows_reserved_chars
Adrian Buehlmann
adrian at cadifra.com
Sun May 8 07:56:50 CDT 2011
# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1304799920 -7200
# Node ID aea8a4d5a0bed8b44485179be7b66e73eb2ee5bc
# Parent fe2153fd0fe5de49790e82d8038f5e07dd502e63
util: rename _windows_reserved_filenames and _windows_reserved_chars
diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -445,10 +445,10 @@
return hardlink, num
-_windows_reserved_filenames = '''con prn aux nul
+_winreservednames = '''con prn aux nul
com1 com2 com3 com4 com5 com6 com7 com8 com9
lpt1 lpt2 lpt3 lpt4 lpt5 lpt6 lpt7 lpt8 lpt9'''.split()
-_windows_reserved_chars = ':*?"<>|'
+_winreservedchars = ':*?"<>|'
def checkwinfilename(path):
'''Check that the base-relative path is a valid filename on Windows.
Returns None if the path is ok, or a UI string describing the problem.
@@ -472,14 +472,14 @@
if not n:
continue
for c in n:
- if c in _windows_reserved_chars:
+ if c in _winreservedchars:
return _("filename contains '%s', which is reserved "
"on Windows") % c
if ord(c) <= 31:
return _("filename contains %r, which is invalid "
"on Windows") % c
base = n.split('.')[0]
- if base and base.lower() in _windows_reserved_filenames:
+ if base and base.lower() in _winreservednames:
return _("filename contains '%s', which is reserved "
"on Windows") % base
t = n[-1]
More information about the Mercurial-devel
mailing list