434 def __iter__(self): |
434 def __iter__(self): |
435 if self.entries is None: |
435 if self.entries is None: |
436 self._load() |
436 self._load() |
437 return iter(self.entries) |
437 return iter(self.entries) |
438 |
438 |
439 class _fncachevfs(scmutil.abstractvfs): |
439 class _fncachevfs(scmutil.abstractvfs, scmutil.auditvfs): |
440 def __init__(self, vfs, fnc, encode): |
440 def __init__(self, vfs, fnc, encode): |
441 self.vfs = vfs |
441 scmutil.auditvfs.__init__(self, vfs) |
442 self.fncache = fnc |
442 self.fncache = fnc |
443 self.encode = encode |
443 self.encode = encode |
444 |
|
445 def _getmustaudit(self): |
|
446 return self.vfs.mustaudit |
|
447 |
|
448 def _setmustaudit(self, onoff): |
|
449 self.vfs.mustaudit = onoff |
|
450 |
|
451 mustaudit = property(_getmustaudit, _setmustaudit) |
|
452 |
444 |
453 def __call__(self, path, mode='r', *args, **kw): |
445 def __call__(self, path, mode='r', *args, **kw): |
454 if mode not in ('r', 'rb') and path.startswith('data/'): |
446 if mode not in ('r', 'rb') and path.startswith('data/'): |
455 self.fncache.add(path) |
447 self.fncache.add(path) |
456 return self.vfs(self.encode(path), mode, *args, **kw) |
448 return self.vfs(self.encode(path), mode, *args, **kw) |