blackbox: do not nullify repo to deactivate the logger on failure
authorYuya Nishihara <yuya@tcha.org>
Sat, 17 Nov 2018 20:56:25 +0900
changeset 40797 3ede5d1724bb
parent 40796 37d6ee46a965
child 40798 567e164f89b8
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.
hgext/blackbox.py
--- a/hgext/blackbox.py	Sun Nov 11 20:02:34 2018 +0900
+++ b/hgext/blackbox.py	Sat Nov 17 20:56:25 2018 +0900
@@ -184,7 +184,7 @@
                 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))