Patchwork D600: util: use set for reserved Windows filenames

login
register
mail settings
Submitter phabricator
Date Sept. 2, 2017, 12:51 p.m.
Message ID <9cfd3dbd4a166ddc7bd1f8c25dd5f767@localhost.localdomain>
Download mbox | patch
Permalink /patch/23623/
State Not Applicable
Headers show

Comments

phabricator - Sept. 2, 2017, 12:51 p.m.
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




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

Patch

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.