dirstate: prevent useless util.fspath() invocation for '.' stable
authorFUJIWARA Katsunori <foozy@lares.dti.ne.jp>
Fri, 16 Dec 2011 21:09:40 +0900
branchstable
changeset 15668 8e020155e76c
parent 15667 eacfd851cb9e
child 15669 390bcd01775a
dirstate: prevent useless util.fspath() invocation for '.' at first of dirstate.walk() on case insensitive filesystem, normalization of '.' causes util.fspath() invocation, but '.' is not cached in it. this invocation is not only useless, but also harmful: initial "hg tag" causes creation of ".hgtags" file after dirstate.walk(), and looking up ".hgtags" in cache will fail, because directory contents of root is already cached at util.fspath() invocation for '.'.
mercurial/dirstate.py
--- a/mercurial/dirstate.py	Fri Dec 16 21:09:40 2011 +0900
+++ b/mercurial/dirstate.py	Fri Dec 16 21:09:40 2011 +0900
@@ -69,6 +69,7 @@
         f = {}
         for name in self._map:
             f[util.normcase(name)] = name
+        f['.'] = '.' # prevents useless util.fspath() invocation
         return f
 
     @propertycache