[PATCH] dirstate._normalize: don't add '.' and '.hg' to _foldmap

Adrian Buehlmann adrian at cadifra.com
Thu Sep 4 07:59:36 CDT 2008


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1220532115 -7200
# Node ID 965604e16c2a53f11b01fb3f28b740602dda568e
# Parent  6c4a08270222569ba906f4f1c7860783eec19225
dirstate._normalize: don't add '.' and '.hg' to _foldmap

nothing to fix, just a minor optimiziation

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -347,6 +347,8 @@
             self._ui.warn(_("not in dirstate: %s\n") % f)
 
     def _normalize(self, path):
+        if path == '.' or path == '.hg':
+            return path
         norm_path = os.path.normcase(os.path.normpath(path))
         if norm_path not in self._foldmap:
             if not os.path.exists(os.path.join(self._root, path)):


More information about the Mercurial-devel mailing list