[issue1273] hg status got flow with changes introduces in 1e2850ed8171

Petr Kodl mercurial-bugs at selenic.com
Thu Aug 21 16:10:56 CDT 2008


New submission from Petr Kodl <petrkodl at gmail.com>:

the denormalization of path causes most of the calls to _normalize to miss the
fold map 

on large repos this causes significant slowdown (factor of 3 on 29k files where
stat goes from 1.7s to 9s) 

following patch fixes the problem: 

diff -r 6dcbe191a9b5 mercurial/dirstate.py
--- a/mercurial/dirstate.py     Mon Aug 18 16:50:36 2008 -0500
+++ b/mercurial/dirstate.py     Thu Aug 21 17:05:34 2008 -0400
@@ -344,11 +344,12 @@
             self._ui.warn(_("not in dirstate: %s\n") % f)

     def _normalize(self, path):
-        if path not in self._foldmap:
+        npath = os.path.normcase(os.path.normpath(path))
+        if npath not in self._foldmap:
             if not os.path.exists(path):
                 return path
-            self._foldmap[path] = util.fspath(path, self._root)
-        return self._foldmap[path]
+            self._foldmap[npath] = util.fspath(path, self._root)
+        return self._foldmap[npath]

     def clear(self):
         self._map = {}

----------
messages: 6827
nosy: pko
priority: bug
status: in-progress
title: hg status got flow with changes introduces in 1e2850ed8171

____________________________________________________
Mercurial issue tracker <mercurial-bugs at selenic.com>
<http://www.selenic.com/mercurial/bts/issue1273>
____________________________________________________



More information about the Mercurial-devel mailing list