D651: blackbox: remove _bbvfs state

2017-09-12 Thread quark (Jun Wu)
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG029b33adbd17: blackbox: remove _bbvfs state (authored by 
quark).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D651?vs=1654&id=1753

REVISION DETAIL
  https://phab.mercurial-scm.org/D651

AFFECTED FILES
  hgext/blackbox.py

CHANGE DETAILS

diff --git a/hgext/blackbox.py b/hgext/blackbox.py
--- a/hgext/blackbox.py
+++ b/hgext/blackbox.py
@@ -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



To: quark, #hg-reviewers, durham
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D651: blackbox: remove _bbvfs state

2017-09-07 Thread durham (Durham Goode)
durham added inline comments.

INLINE COMMENTS

> blackbox.py:100
> +if repo:
> +return repo.vfs
> +

I'd probably explicitly return None instead of relying on the implicit return 
value.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D651

To: quark, #hg-reviewers, durham
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D651: blackbox: remove _bbvfs state

2017-09-06 Thread quark (Jun Wu)
quark created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  `_bbvfs` is redundant because it could be calcualted from `_bbrepo`.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D651

AFFECTED FILES
  hgext/blackbox.py

CHANGE DETAILS

diff --git a/hgext/blackbox.py b/hgext/blackbox.py
--- a/hgext/blackbox.py
+++ b/hgext/blackbox.py
@@ -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



To: quark, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel