Mercurial > hg
changeset 29718:2dd8c225e94c
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.
author | Pierre-Yves David <pierre-yves.david@ens-lyon.org> |
---|---|
date | Thu, 04 Aug 2016 16:56:50 +0200 |
parents | 37b6f0ec6241 |
children | acf27be56d26 |
files | mercurial/scmutil.py |
diffstat | 1 files changed, 3 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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: