Mercurial > hg
changeset 34110:029b33adbd17
blackbox: remove _bbvfs state
`_bbvfs` is redundant because it could be calcualted from `_bbrepo`.
Differential Revision: https://phab.mercurial-scm.org/D651
author | Jun Wu <quark@fb.com> |
---|---|
date | Wed, 06 Sep 2017 21:12:27 -0700 |
parents | cf04db16f583 |
children | 798b679680aa |
files | hgext/blackbox.py |
diffstat | 1 files changed, 7 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/blackbox.py Wed Sep 06 21:08:59 2017 -0700 +++ b/hgext/blackbox.py Wed Sep 06 21:12:27 2017 -0700 @@ -82,19 +82,23 @@ else: self._bbinlog = False self._bbrepo = getattr(src, '_bbrepo', None) - self._bbvfs = getattr(src, '_bbvfs', None) def _partialinit(self): - if util.safehasattr(self, '_bbvfs'): + if self._bbvfs: return self._bbinlog = False self._bbrepo = None - self._bbvfs = None def copy(self): self._partialinit() return self.__class__(self) + @property + def _bbvfs(self): + repo = getattr(self, '_bbrepo', None) + if repo: + return repo.vfs + @util.propertycache def track(self): return self.configlist('blackbox', 'track', ['*']) @@ -194,7 +198,6 @@ def setrepo(self, repo): self._bbinlog = False self._bbrepo = repo - self._bbvfs = repo.vfs ui.__class__ = blackboxui uimod.ui = blackboxui