##// END OF EJS Templates
scmutil: abstract out mustaudit delegation
Bryan O'Sullivan -
r17845:408ded42 stable
parent child Browse files
Show More
@@ -348,6 +348,18 b' class vfs(abstractvfs):'
348
348
349 opener = vfs
349 opener = vfs
350
350
351 class auditvfs(object):
352 def __init__(self, vfs):
353 self.vfs = vfs
354
355 def _getmustaudit(self):
356 return self.vfs.mustaudit
357
358 def _setmustaudit(self, onoff):
359 self.vfs.mustaudit = onoff
360
361 mustaudit = property(_getmustaudit, _setmustaudit)
362
351 class filtervfs(abstractvfs):
363 class filtervfs(abstractvfs):
352 '''Wrapper vfs for filtering filenames with a function.'''
364 '''Wrapper vfs for filtering filenames with a function.'''
353
365
@@ -436,20 +436,12 b' class fncache(object):'
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
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
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)
General Comments 0
You need to be logged in to leave comments. Login now