D600: util: use set for reserved Windows filenames

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Sat Sep 2 08:51:46 EDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGca6a3852daf0: util: use set for reserved Windows filenames (authored by indygreg).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D600?vs=1532&id=1575

REVISION DETAIL
  https://phab.mercurial-scm.org/D600

AFFECTED FILES
  mercurial/util.py

CHANGE DETAILS

diff --git a/mercurial/util.py b/mercurial/util.py
--- a/mercurial/util.py
+++ b/mercurial/util.py
@@ -1230,9 +1230,11 @@
 
     return hardlink, num
 
-_winreservednames = b'''con prn aux nul
-    com1 com2 com3 com4 com5 com6 com7 com8 com9
-    lpt1 lpt2 lpt3 lpt4 lpt5 lpt6 lpt7 lpt8 lpt9'''.split()
+_winreservednames = {
+    'con', 'prn', 'aux', 'nul',
+    'com1', 'com2', 'com3', 'com4', 'com5', 'com6', 'com7', 'com8', 'com9',
+    'lpt1', 'lpt2', 'lpt3', 'lpt4', 'lpt5', 'lpt6', 'lpt7', 'lpt8', 'lpt9',
+}
 _winreservedchars = ':*?"<>|'
 def checkwinfilename(path):
     r'''Check that the base-relative path is a valid filename on Windows.



To: indygreg, #hg-reviewers, quark
Cc: martinvonz, quark, mercurial-devel


More information about the Mercurial-devel mailing list