changeset 24322:f263814c72ac

manifest: add dirs() to manifestdict Manifests should have a method of accessing its own dirs, not just the context that references the manifest. This makes it easier for other optimized versions of manifests to compute their own dirs in the most efficient way.
author Drew Gottlieb <drgott@google.com>
date Fri, 13 Mar 2015 15:19:54 -0700
parents 0a714a1f7d5c
children 4c7c6beade1a
files mercurial/manifest.py
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/manifest.py	Wed Sep 17 22:34:34 2014 +0900
+++ b/mercurial/manifest.py	Fri Mar 13 15:19:54 2015 -0700
@@ -6,9 +6,10 @@
 # GNU General Public License version 2 or any later version.
 
 from i18n import _
-import mdiff, parsers, error, revlog, util
+import mdiff, parsers, error, revlog, util, scmutil
 import array, struct
 
+propertycache = util.propertycache
 
 class _lazymanifest(dict):
     """This is the pure implementation of lazymanifest.
@@ -147,6 +148,13 @@
         files.difference_update(m2)
         return files
 
+    @propertycache
+    def _dirs(self):
+        return scmutil.dirs(self)
+
+    def dirs(self):
+        return self._dirs
+
     def matches(self, match):
         '''generate a new manifest filtered by the match argument'''
         if match.always():