Show More
@@ -367,8 +367,8 b' class encodedstore(basicstore):' | |||||
367 | class fncache(object): |
|
367 | class fncache(object): | |
368 | # the filename used to be partially encoded |
|
368 | # the filename used to be partially encoded | |
369 | # hence the encodedir/decodedir dance |
|
369 | # hence the encodedir/decodedir dance | |
370 |
def __init__(self, |
|
370 | def __init__(self, vfs): | |
371 |
self. |
|
371 | self.vfs = vfs | |
372 | self.entries = None |
|
372 | self.entries = None | |
373 | self._dirty = False |
|
373 | self._dirty = False | |
374 |
|
374 | |||
@@ -376,7 +376,7 b' class fncache(object):' | |||||
376 | '''fill the entries from the fncache file''' |
|
376 | '''fill the entries from the fncache file''' | |
377 | self._dirty = False |
|
377 | self._dirty = False | |
378 | try: |
|
378 | try: | |
379 |
fp = self. |
|
379 | fp = self.vfs('fncache', mode='rb') | |
380 | except IOError: |
|
380 | except IOError: | |
381 | # skip nonexistent file |
|
381 | # skip nonexistent file | |
382 | self.entries = set() |
|
382 | self.entries = set() | |
@@ -391,7 +391,7 b' class fncache(object):' | |||||
391 | fp.close() |
|
391 | fp.close() | |
392 |
|
392 | |||
393 | def _write(self, files, atomictemp): |
|
393 | def _write(self, files, atomictemp): | |
394 |
fp = self. |
|
394 | fp = self.vfs('fncache', mode='wb', atomictemp=atomictemp) | |
395 | if files: |
|
395 | if files: | |
396 | fp.write(encodedir('\n'.join(files) + '\n')) |
|
396 | fp.write(encodedir('\n'.join(files) + '\n')) | |
397 | fp.close() |
|
397 | fp.close() | |
@@ -424,22 +424,22 b' class fncache(object):' | |||||
424 |
|
424 | |||
425 | class _fncachevfs(scmutil.abstractvfs): |
|
425 | class _fncachevfs(scmutil.abstractvfs): | |
426 | def __init__(self, vfs, fnc, encode): |
|
426 | def __init__(self, vfs, fnc, encode): | |
427 |
self. |
|
427 | self.vfs = vfs | |
428 | self.fncache = fnc |
|
428 | self.fncache = fnc | |
429 | self.encode = encode |
|
429 | self.encode = encode | |
430 |
|
430 | |||
431 | def _getmustaudit(self): |
|
431 | def _getmustaudit(self): | |
432 |
return self. |
|
432 | return self.vfs.mustaudit | |
433 |
|
433 | |||
434 | def _setmustaudit(self, onoff): |
|
434 | def _setmustaudit(self, onoff): | |
435 |
self. |
|
435 | self.vfs.mustaudit = onoff | |
436 |
|
436 | |||
437 | mustaudit = property(_getmustaudit, _setmustaudit) |
|
437 | mustaudit = property(_getmustaudit, _setmustaudit) | |
438 |
|
438 | |||
439 | def __call__(self, path, mode='r', *args, **kw): |
|
439 | def __call__(self, path, mode='r', *args, **kw): | |
440 | if mode not in ('r', 'rb') and path.startswith('data/'): |
|
440 | if mode not in ('r', 'rb') and path.startswith('data/'): | |
441 | self.fncache.add(path) |
|
441 | self.fncache.add(path) | |
442 |
return self. |
|
442 | return self.vfs(self.encode(path), mode, *args, **kw) | |
443 |
|
443 | |||
444 | class fncachestore(basicstore): |
|
444 | class fncachestore(basicstore): | |
445 | def __init__(self, path, vfstype, dotencode): |
|
445 | def __init__(self, path, vfstype, dotencode): |
General Comments 0
You need to be logged in to leave comments.
Login now