mercurial/manifest.py
changeset 24322 f263814c72ac
parent 24298 49cd847fd69a
child 24324 149cc171e4a0
equal deleted inserted replaced
24321:0a714a1f7d5c 24322:f263814c72ac
     4 #
     4 #
     5 # This software may be used and distributed according to the terms of the
     5 # This software may be used and distributed according to the terms of the
     6 # GNU General Public License version 2 or any later version.
     6 # GNU General Public License version 2 or any later version.
     7 
     7 
     8 from i18n import _
     8 from i18n import _
     9 import mdiff, parsers, error, revlog, util
     9 import mdiff, parsers, error, revlog, util, scmutil
    10 import array, struct
    10 import array, struct
    11 
    11 
       
    12 propertycache = util.propertycache
    12 
    13 
    13 class _lazymanifest(dict):
    14 class _lazymanifest(dict):
    14     """This is the pure implementation of lazymanifest.
    15     """This is the pure implementation of lazymanifest.
    15 
    16 
    16     It has not been optimized *at all* and is not lazy.
    17     It has not been optimized *at all* and is not lazy.
   144     def filesnotin(self, m2):
   145     def filesnotin(self, m2):
   145         '''Set of files in this manifest that are not in the other'''
   146         '''Set of files in this manifest that are not in the other'''
   146         files = set(self)
   147         files = set(self)
   147         files.difference_update(m2)
   148         files.difference_update(m2)
   148         return files
   149         return files
       
   150 
       
   151     @propertycache
       
   152     def _dirs(self):
       
   153         return scmutil.dirs(self)
       
   154 
       
   155     def dirs(self):
       
   156         return self._dirs
   149 
   157 
   150     def matches(self, match):
   158     def matches(self, match):
   151         '''generate a new manifest filtered by the match argument'''
   159         '''generate a new manifest filtered by the match argument'''
   152         if match.always():
   160         if match.always():
   153             return self.copy()
   161             return self.copy()