[PATCH 05 of 13 STABLE V4] dirstate: prevent useless util.fspath() invocation for '.'

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Fri Dec 16 06:27:13 CST 2011


# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1324037380 -32400
# Branch stable
# Node ID 38bc7e88a2b9a62d60913acc7c596322b34e5d68
# Parent  4708d2c872d99a2881506755d76e20aa5f3474ad
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 '.'.

diff -r 4708d2c872d9 -r 38bc7e88a2b9 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


More information about the Mercurial-devel mailing list