vfs: use propertycache for open
The current open method is currently behaving like a property cache. We use our
utility decorator to make this explicit.
--- a/mercurial/scmutil.py Fri Aug 05 17:27:51 2016 -0400
+++ b/mercurial/scmutil.py Thu Aug 04 16:56:50 2016 +0200
@@ -256,17 +256,15 @@
raise
return []
- def open(self, path, mode="r", text=False, atomictemp=False,
- notindexed=False, backgroundclose=False):
+ @util.propertycache
+ def open(self):
'''Open ``path`` file, which is relative to vfs root.
Newly created directories are marked as "not to be indexed by
the content indexing service", if ``notindexed`` is specified
for "write" mode access.
'''
- self.open = self.__call__
- return self.__call__(path, mode, text, atomictemp, notindexed,
- backgroundclose=backgroundclose)
+ return self.__call__
def read(self, path):
with self(path, 'rb') as fp: