changeset 34335:af9722412ac3

dirstate: move _dirs to dirstatemap As part of moving the dirstate storage logic to a new class, lets move the _dirs computation onto the class so extensions can replace it with a persisted index of directories. Differential Revision: https://phab.mercurial-scm.org/D755
author Durham Goode <durham@fb.com>
date Tue, 26 Sep 2017 03:56:20 -0700
parents d8b35920b7b1
children 0865d25e8a8a
files mercurial/dirstate.py
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py	Tue Sep 26 03:56:20 2017 -0700
+++ b/mercurial/dirstate.py	Tue Sep 26 03:56:20 2017 -0700
@@ -210,7 +210,7 @@
 
     @propertycache
     def _dirs(self):
-        return util.dirs(self._map._map, 'r')
+        return self._map.dirs()
 
     def dirs(self):
         return self._dirs
@@ -1375,3 +1375,9 @@
                 f[normcase(name)] = name
         f['.'] = '.' # prevents useless util.fspath() invocation
         return f
+
+    def dirs(self):
+        """Returns a set-like object containing all the directories in the
+        current dirstate.
+        """
+        return util.dirs(self._map, 'r')