diff -r 5bd3d6b264c1 -r 345cdb93851b hgext/blackbox.py --- a/hgext/blackbox.py Sun Nov 11 16:34:49 2018 +0900 +++ b/hgext/blackbox.py Sun Nov 11 16:38:43 2018 +0900 @@ -157,18 +157,15 @@ if self._bbvfs: ui = self - else: + elif lastui and lastui._bbvfs: # certain ui instances exist outside the context of # a repo, so just default to the last blackbox that # was seen. ui = lastui - - if not ui: - return - vfs = ui._bbvfs - if not vfs: + else: return + vfs = ui._bbvfs repo = ui._bbrepo lastui = ui