Mercurial > hg > mercurial-source
changeset 33474:5d8dd6c90af9
obsstore: move _version to a propertycache
This makes sure _version is correct even if "_all" is not called.
author | Jun Wu <quark@fb.com> |
---|---|
date | Sun, 04 Jun 2017 08:49:15 -0700 |
parents | 3fad59faba8a |
children | 9576974a3b6d |
files | mercurial/obsolete.py |
diffstat | 1 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/obsolete.py +++ b/mercurial/obsolete.py @@ -555,7 +555,7 @@ # caches for various obsolescence related cache self.caches = {} self.svfs = svfs - self._version = defaultformat + self._defaultformat = defaultformat self._readonly = readonly def __iter__(self): @@ -670,6 +670,13 @@ return self.svfs.tryread('obsstore') @propertycache + def _version(self): + if len(self._data) >= 1: + return _readmarkerversion(self._data) + else: + return self._defaultformat + + @propertycache def _all(self): data = self._data if not data: