# HG changeset patch # User Pierre-Yves David # Date 2016-08-04 14:56:50 # Node ID 2dd8c225e94c19d03713458bbeacc71c30347c51 # Parent 37b6f0ec6241a62de90737409458cd622e2fac0d 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. diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py --- a/mercurial/scmutil.py +++ b/mercurial/scmutil.py @@ -256,17 +256,15 @@ class abstractvfs(object): 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: