blackbox: do not assume self._bb{vfs,repo,fp} are set in blackboxui.__init__

It's possible for the blackboxui code to do a "del self._bbvfs", then ui.copy()
or similar attempt will fail. It will also fail when constructing a blackboxui
from a non-blackbox ui.
This patch fixes the issue by not assuming any _bb* attr is set.
This commit is contained in:
Jun Wu 2016-03-15 10:36:02 +00:00
parent f94ba7eabd
commit d487d6ed63

View File

@ -80,10 +80,10 @@ def wrapui(ui):
if src is None: if src is None:
self._partialinit() self._partialinit()
else: else:
self._bbfp = src._bbfp self._bbfp = getattr(src, '_bbfp', None)
self._bbinlog = False self._bbinlog = False
self._bbrepo = src._bbrepo self._bbrepo = getattr(src, '_bbrepo', None)
self._bbvfs = src._bbvfs self._bbvfs = getattr(src, '_bbvfs', None)
def _partialinit(self): def _partialinit(self):
if util.safehasattr(self, '_bbvfs'): if util.safehasattr(self, '_bbvfs'):