diff --git a/hgext/blackbox.py b/hgext/blackbox.py --- a/hgext/blackbox.py +++ b/hgext/blackbox.py @@ -77,9 +77,13 @@ class blackboxui(ui.__class__): @property def _bbvfs(self): + vfs = None repo = getattr(self, '_bbrepo', None) if repo: - return repo.vfs + vfs = repo.vfs + if not vfs.isdir('.'): + vfs = None + return vfs @util.propertycache def track(self): @@ -136,6 +140,10 @@ if not ui: return + vfs = ui._bbvfs + if not vfs: + return + repo = getattr(ui, '_bbrepo', None) if not lastui or repo: lastui = ui diff --git a/tests/test-blackbox.t b/tests/test-blackbox.t --- a/tests/test-blackbox.t +++ b/tests/test-blackbox.t @@ -286,6 +286,14 @@ $ cd .. +With chg, blackbox should not log into other repos + + $ hg init repo1 + $ hg init repo2 + $ hg --config extensions.a=! -R repo1 log + $ rm -rf $TESTTMP/repo1 + $ hg --config extensions.a=! init repo1 + #endif blackbox should work if repo.ui.log is not called (issue5518)