[PATCH 3 of 7] blackbox: retry opening the log file

Yuya Nishihara yuya at tcha.org
Wed Feb 3 15:24:50 UTC 2016


On Mon, 01 Feb 2016 22:14:12 -0600, timeless wrote:
> # HG changeset patch
> # User timeless <timeless at mozdev.org>
> # Date 1454011703 0
> #      Thu Jan 28 20:08:23 2016 +0000
> # Node ID 2ee516dce0abb9edc054dd428a169b0d26d7ee29
> # Parent  f74757227e3cfdbfbd64e37085d0772e6dae4e29
> blackbox: retry opening the log file
> 
> diff --git a/hgext/blackbox.py b/hgext/blackbox.py
> --- a/hgext/blackbox.py
> +++ b/hgext/blackbox.py
> @@ -94,7 +94,7 @@
>              if not '*' in self.track and not event in self.track:
>                  return
>  
> -            if util.safehasattr(self, '_blackbox'):
> +            if util.safehasattr(self, '_blackbox') and self._blackbox:
>                  blackbox = self
>              elif util.safehasattr(self, '_bbopener'):
>                  try:

Which is the expected behavior? Can you add a test that reflects it?

 a) retry every time log() is called, which would mean "cannot write to
    blackbox.log" would be printed repeatedly if repository is readonly.
 b) retry next time _bbopener is attached by setrepo()


More information about the Mercurial-devel mailing list