diff mercurial/store.py @ 7514:e54cf540c6ca

store: don't create dirs ending in period or space for hashed paths (issue1417) Windows won't create directories with names ending in period or space, so we replace the last period/space character in truncated directory names of hashed paths with some other character (underbar).
author Adrian Buehlmann <adrian@cadifra.com>
date Sat, 13 Dec 2008 17:39:56 +0100
parents 810ca383da9c
children ee5aba886108
line wrap: on
line diff
--- a/mercurial/store.py	Thu Dec 11 13:33:35 2008 +0000
+++ b/mercurial/store.py	Sat Dec 13 17:39:56 2008 +0100
@@ -111,6 +111,9 @@
         sdirs = []
         for p in parts[:-1]:
             d = p[:DIR_PREFIX_LEN]
+            if d[-1] in '. ':
+                # Windows can't access dirs ending in period or space
+                d = d[:-1] + '_'
             t = '/'.join(sdirs) + '/' + d
             if len(t) > _MAX_SHORTENED_DIRS_LEN:
                 break