[PATCH] util: rename _windows_reserved_filenames and _windows_reserved_chars

Adrian Buehlmann adrian at cadifra.com
Sat May 7 16:07:29 CDT 2011


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1304799920 -7200
# Node ID 4168febc29ffaee26de5cc1b1289454e4c85debf
# 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
+_winresnames = '''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 = ':*?"<>|'
+_winreschars = ':*?"<>|'
 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 _winreschars:
                 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 _winresnames:
             return _("filename contains '%s', which is reserved "
                      "on Windows") % base
         t = n[-1]


More information about the Mercurial-devel mailing list