# HG changeset patch # User Yuya Nishihara # Date 2018-11-17 11:56:25 # Node ID 3ede5d1724bbbd007b6f097d5b800d499674aa5e # Parent 37d6ee46a9650186964ccc71cf0656995e1f3522 blackbox: do not nullify repo to deactivate the logger on failure The _repo will be a mandatory attribute. Instead, make the logger to not track any events. diff --git a/hgext/blackbox.py b/hgext/blackbox.py --- a/hgext/blackbox.py +++ b/hgext/blackbox.py @@ -184,7 +184,7 @@ class blackboxlogger(object): fp.write(fmt % args) except (IOError, OSError) as err: # deactivate this to avoid failed logging again - self._repo = None + self._trackedevents.clear() ui.debug('warning: cannot write to blackbox.log: %s\n' % encoding.strtolocal(err.strerror))