# HG changeset patch # User Pierre-Yves David # Date 1470322610 -7200 # 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 -r 37b6f0ec6241 -r 2dd8c225e94c mercurial/scmutil.py --- 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: