diff mercurial/localrepo.py @ 12687:34d8247a4595

store: encode first period or space in filenames (issue1713) - Mac OS X has problems with filenames starting with '._' (e.g. '.FOO' -> '._f_o_o' is now encoded as '~2e_f_o_o') - Explorer of Windows Vista and Windows 7 strip leading spaces of path elements of filenames when copying trees Above problems are avoided by encoding the first space (as '~20') or period (as '~2e') of all path elements. This introduces a new entry 'dotencode' in .hg/requires, that is, a new repository filename layout (inside .hg/store). Newly created repositories require 'dotencode' by default. Specifying [format] dotencode = False in a config file will use the old format instead. Prior Mercurial versions will abort with the message abort: requirement 'dotencode' not supported! when trying to access a local repository that requires 'dotencode'. New 'dotencode' repositories can be converted to the previous repository format with hg --config format.dotencode=0 clone --pull repoA repoB
author Adrian Buehlmann <adrian@cadifra.com>
date Sat, 09 Oct 2010 21:54:50 +0200
parents 01b6f058021b
children 9ca08fbb750a
line wrap: on
line diff
--- a/mercurial/localrepo.py	Tue Sep 14 23:00:39 2010 +0200
+++ b/mercurial/localrepo.py	Sat Oct 09 21:54:50 2010 +0200
@@ -22,7 +22,8 @@
 class localrepository(repo.repository):
     capabilities = set(('lookup', 'changegroupsubset', 'branchmap', 'pushkey'))
     supportedformats = set(('revlogv1', 'parentdelta'))
-    supported = supportedformats | set(('store', 'fncache', 'shared'))
+    supported = supportedformats | set(('store', 'fncache', 'shared',
+                                        'dotencode'))
 
     def __init__(self, baseui, path=None, create=0):
         repo.repository.__init__(self)
@@ -52,6 +53,8 @@
                     requirements.append("store")
                     if self.ui.configbool('format', 'usefncache', True):
                         requirements.append("fncache")
+                        if self.ui.configbool('format', 'dotencode', True):
+                            requirements.append('dotencode')
                     # create an invalid changelog
                     self.opener("00changelog.i", "a").write(
                         '\0\0\0\2' # represents revlogv2