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
--- 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')