Patchwork D754: dirstate: move filefoldmap to dirstatemap

login
register
mail settings
Submitter phabricator
Date Sept. 26, 2017, 10:58 a.m.
Message ID <5db50e7e00fa0d20caea45e8f6f24734@localhost.localdomain>
Download mbox | patch
Permalink /patch/24152/
State Not Applicable
Headers show

Comments

phabricator - Sept. 26, 2017, 10:58 a.m.
durham updated this revision to Diff 2078.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D754?vs=1949&id=2078

REVISION DETAIL
  https://phab.mercurial-scm.org/D754

AFFECTED FILES
  mercurial/dirstate.py

CHANGE DETAILS




To: durham, #hg-reviewers, indygreg
Cc: indygreg, mercurial-devel

Patch

diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -160,21 +160,7 @@ 
 
     @propertycache
     def _filefoldmap(self):
-        try:
-            makefilefoldmap = parsers.make_file_foldmap
-        except AttributeError:
-            pass
-        else:
-            return makefilefoldmap(self._map._map, util.normcasespec,
-                                   util.normcasefallback)
-
-        f = {}
-        normcase = util.normcase
-        for name, s in self._map.iteritems():
-            if s[0] != 'r':
-                f[normcase(name)] = name
-        f['.'] = '.' # prevents useless util.fspath() invocation
-        return f
+        return self._map.filefoldmap()
 
     @propertycache
     def _dirfoldmap(self):
@@ -1370,3 +1356,22 @@ 
                     otherparent.add(fname)
             return nonnorm, otherparent
 
+    def filefoldmap(self):
+        """Returns a dictionary mapping normalized case paths to their
+        non-normalized versions.
+        """
+        try:
+            makefilefoldmap = parsers.make_file_foldmap
+        except AttributeError:
+            pass
+        else:
+            return makefilefoldmap(self._map, util.normcasespec,
+                                   util.normcasefallback)
+
+        f = {}
+        normcase = util.normcase
+        for name, s in self._map.iteritems():
+            if s[0] != 'r':
+                f[normcase(name)] = name
+        f['.'] = '.' # prevents useless util.fspath() invocation
+        return f