mercurial/localrepo.py
branchstable
changeset 42323 c2b83c957621
parent 42141 0e41f40b01cc
child 42324 2338bdea4474
equal deleted inserted replaced
42322:d2c871b78c36 42323:c2b83c957621
   119         for path in paths:
   119         for path in paths:
   120             _cachedfiles.add((path, ''))
   120             _cachedfiles.add((path, ''))
   121 
   121 
   122     def join(self, obj, fname):
   122     def join(self, obj, fname):
   123         return obj.sjoin(fname)
   123         return obj.sjoin(fname)
       
   124 
       
   125 class mixedrepostorecache(_basefilecache):
       
   126     """filecache for a mix files in .hg/store and outside"""
       
   127     def __init__(self, *pathsandlocations):
       
   128         # scmutil.filecache only uses the path for passing back into our
       
   129         # join(), so we can safely pass a list of paths and locations
       
   130         super(mixedrepostorecache, self).__init__(*pathsandlocations)
       
   131         for path, location in pathsandlocations:
       
   132             _cachedfiles.update(pathsandlocations)
       
   133 
       
   134     def join(self, obj, fnameandlocation):
       
   135         fname, location = fnameandlocation
       
   136         if location == '':
       
   137             return obj.vfs.join(fname)
       
   138         else:
       
   139             if location != 'store':
       
   140                 raise error.ProgrammingError('unexpected location: %s' %
       
   141                                              location)
       
   142             return obj.sjoin(fname)
   124 
   143 
   125 def isfilecached(repo, name):
   144 def isfilecached(repo, name):
   126     """check if a repo has already cached "name" filecache-ed property
   145     """check if a repo has already cached "name" filecache-ed property
   127 
   146 
   128     This returns (cachedobj-or-None, iscached) tuple.
   147     This returns (cachedobj-or-None, iscached) tuple.