icasefs: use case preserved root for 'util.fspath()' invocation (issue3302) stable
authorFUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Thu, 15 Mar 2012 00:46:37 +0900
branchstable
changeset 16258 594fc9329628
parent 16257 7a5524f240ad
child 16261 7b9bf72430ba
child 16264 0628290d98df
icasefs: use case preserved root for 'util.fspath()' invocation (issue3302) path to repo root may contains case sensitive part, even though repo is located in case insensitive filesystem: e.g. repo in FAT32 device mounted on Unix. so, case normalized root causes failure of stat(2). this patch uses case preserved root for 'util.fspath()' invocation to avoid this problem. case preserved root for 'util.fspath()' may decrease efficiency of fspath cache, but 'util.fspath()' is currently called only from dirstate, so this fix has less impact.
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Wed Mar 14 14:45:41 2012 -0500
+++ b/mercurial/dirstate.py	Thu Mar 15 00:46:37 2012 +0900
@@ -78,10 +78,6 @@
         return self._copymap
 
     @propertycache
-    def _normroot(self):
-        return util.normcase(self._root)
-
-    @propertycache
     def _foldmap(self):
         f = {}
         for name in self._map:
@@ -406,7 +402,7 @@
                 folded = path
             else:
                 folded = self._foldmap.setdefault(normed,
-                                util.fspath(normed, self._normroot))
+                                util.fspath(normed, self._root))
         return folded
 
     def normalize(self, path, isknown=False):