##// END OF EJS Templates
icasefs: avoid normcase()-ing in util.fspath() for efficiency...
FUJIWARA Katsunori -
r15670:d6c19cfa stable
parent child Browse files
Show More
@@ -65,6 +65,10 b' class dirstate(object):'
65 return self._copymap
65 return self._copymap
66
66
67 @propertycache
67 @propertycache
68 def _normroot(self):
69 return util.normcase(self._root)
70
71 @propertycache
68 def _foldmap(self):
72 def _foldmap(self):
69 f = {}
73 f = {}
70 for name in self._map:
74 for name in self._map:
@@ -384,7 +388,7 b' class dirstate(object):'
384 folded = path
388 folded = path
385 else:
389 else:
386 folded = self._foldmap.setdefault(normed,
390 folded = self._foldmap.setdefault(normed,
387 util.fspath(path, self._root))
391 util.fspath(normed, self._normroot))
388 return folded
392 return folded
389
393
390 def normalize(self, path, isknown=False):
394 def normalize(self, path, isknown=False):
@@ -616,10 +616,10 b' def fspath(name, root):'
616 The name is either relative to root, or it is an absolute path starting
616 The name is either relative to root, or it is an absolute path starting
617 with root. Note that this function is unnecessary, and should not be
617 with root. Note that this function is unnecessary, and should not be
618 called, for case-sensitive filesystems (simply because it's expensive).
618 called, for case-sensitive filesystems (simply because it's expensive).
619
620 Both name and root should be normcase-ed.
619 '''
621 '''
620 # If name is absolute, make it relative
622 # If name is absolute, make it relative
621 name = normcase(name)
622 root = normcase(root)
623 if name.startswith(root):
623 if name.startswith(root):
624 l = len(root)
624 l = len(root)
625 if name[l] == os.sep or name[l] == os.altsep:
625 if name[l] == os.sep or name[l] == os.altsep:
General Comments 0
You need to be logged in to leave comments. Login now