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