# HG changeset patch
# User Yuya Nishihara <y...@tcha.org>
# Date 1542455785 -32400
#      Sat Nov 17 20:56:25 2018 +0900
# Node ID 47d8e701444c98d355794b1a398e25840557a2b1
# Parent  abd5a060c6c9dfd455ecec7ff8a4f6a831ea8060
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))
 
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to