dirstate: move _dirs to dirstatemap
authorDurham Goode <durham@fb.com>
Tue, 26 Sep 2017 03:56:20 -0700
changeset 34335 af9722412ac3
parent 34334 d8b35920b7b1
child 34336 0865d25e8a8a
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
mercurial/dirstate.py
--- 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')