changeset 17722:3b976051034d

store: rename field name from "opener" to "vfs" in internal classes for fncache These fields are used only in store module, so keeping "self.opener" for backward compatibility like as "localrepository" class is not needed.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Tue, 09 Oct 2012 01:41:55 +0900
parents cf236e3501c3
children ab23768746fd
files mercurial/store.py
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/store.py	Tue Oct 09 01:41:55 2012 +0900
+++ b/mercurial/store.py	Tue Oct 09 01:41:55 2012 +0900
@@ -367,8 +367,8 @@
 class fncache(object):
     # the filename used to be partially encoded
     # hence the encodedir/decodedir dance
-    def __init__(self, opener):
-        self.opener = opener
+    def __init__(self, vfs):
+        self.vfs = vfs
         self.entries = None
         self._dirty = False
 
@@ -376,7 +376,7 @@
         '''fill the entries from the fncache file'''
         self._dirty = False
         try:
-            fp = self.opener('fncache', mode='rb')
+            fp = self.vfs('fncache', mode='rb')
         except IOError:
             # skip nonexistent file
             self.entries = set()
@@ -391,7 +391,7 @@
         fp.close()
 
     def _write(self, files, atomictemp):
-        fp = self.opener('fncache', mode='wb', atomictemp=atomictemp)
+        fp = self.vfs('fncache', mode='wb', atomictemp=atomictemp)
         if files:
             fp.write(encodedir('\n'.join(files) + '\n'))
         fp.close()
@@ -424,22 +424,22 @@
 
 class _fncachevfs(scmutil.abstractvfs):
     def __init__(self, vfs, fnc, encode):
-        self.opener = vfs
+        self.vfs = vfs
         self.fncache = fnc
         self.encode = encode
 
     def _getmustaudit(self):
-        return self.opener.mustaudit
+        return self.vfs.mustaudit
 
     def _setmustaudit(self, onoff):
-        self.opener.mustaudit = onoff
+        self.vfs.mustaudit = onoff
 
     mustaudit = property(_getmustaudit, _setmustaudit)
 
     def __call__(self, path, mode='r', *args, **kw):
         if mode not in ('r', 'rb') and path.startswith('data/'):
             self.fncache.add(path)
-        return self.opener(self.encode(path), mode, *args, **kw)
+        return self.vfs(self.encode(path), mode, *args, **kw)
 
 class fncachestore(basicstore):
     def __init__(self, path, vfstype, dotencode):