Patchwork [01,of,13] configitems: register the 'blackbox.track' config

login
register
mail settings
Submitter Boris Feld
Date Oct. 9, 2017, 8:21 a.m.
Message ID <cdac8099d6c07e3d96e1.1507537308@FB>
Download mbox | patch
Permalink /patch/24644/
State Accepted
Headers show

Comments

Boris Feld - Oct. 9, 2017, 8:21 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1507486294 -7200
#      Sun Oct 08 20:11:34 2017 +0200
# Node ID cdac8099d6c07e3d96e1c7c8fadab713f2111bd7
# Parent  8cef8f7d51d0f1e99889779ec1320d5c9c3b91de
# EXP-Topic config.register
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r cdac8099d6c0
configitems: register the 'blackbox.track' config
via Mercurial-devel - Oct. 11, 2017, 6:23 a.m.
On Mon, Oct 9, 2017 at 1:21 AM, Boris Feld <boris.feld@octobus.net> wrote:

> # HG changeset patch
> # User Boris Feld <boris.feld@octobus.net>
> # Date 1507486294 -7200
> #      Sun Oct 08 20:11:34 2017 +0200
> # Node ID cdac8099d6c07e3d96e1c7c8fadab713f2111bd7
> # Parent  8cef8f7d51d0f1e99889779ec1320d5c9c3b91de
> # EXP-Topic config.register
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r
> cdac8099d6c0
> configitems: register the 'blackbox.track' config
>
> diff -r 8cef8f7d51d0 -r cdac8099d6c0 hgext/blackbox.py
> --- a/hgext/blackbox.py Thu Oct 05 20:41:50 2017 -0700
> +++ b/hgext/blackbox.py Sun Oct 08 20:11:34 2017 +0200
> @@ -70,6 +70,9 @@
>  configitem('blackbox', 'logsource',
>      default=False,
>  )
> +configitem('blackbox', 'track',
> +    default=['*'],
> +)
>

Should not use mutable value as default. See 77e666f943a6 (configitems:
support callable as a default value, 2017-06-28). Right?

The patch is pretty deep in the stack of queued commits, so I'll accept,
but please send a followup.


>  lastui = None
>
> @@ -121,7 +124,7 @@
>
>          @util.propertycache
>          def track(self):
> -            return self.configlist('blackbox', 'track', ['*'])
> +            return self.configlist('blackbox', 'track')
>
>          def log(self, event, *msg, **opts):
>              global lastui
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
Boris Feld - Oct. 11, 2017, 1:42 p.m.
On Tue, 2017-10-10 at 23:23 -0700, Martin von Zweigbergk wrote:
> On Mon, Oct 9, 2017 at 1:21 AM, Boris Feld <boris.feld@octobus.net>
> wrote:
> > # HG changeset patch
> > 
> > # User Boris Feld <boris.feld@octobus.net>
> > 
> > # Date 1507486294 -7200
> > 
> > #      Sun Oct 08 20:11:34 2017 +0200
> > 
> > # Node ID cdac8099d6c07e3d96e1c7c8fadab713f2111bd7
> > 
> > # Parent  8cef8f7d51d0f1e99889779ec1320d5c9c3b91de
> > 
> > # EXP-Topic config.register
> > 
> > # Available At https://bitbucket.org/octobus/mercurial-devel/
> > 
> > #              hg pull https://bitbucket.org/octobus/mercurial-deve
> > l/ -r cdac8099d6c0
> > 
> > configitems: register the 'blackbox.track' config
> > 
> > 
> > 
> > diff -r 8cef8f7d51d0 -r cdac8099d6c0 hgext/blackbox.py
> > 
> > --- a/hgext/blackbox.py Thu Oct 05 20:41:50 2017 -0700
> > 
> > +++ b/hgext/blackbox.py Sun Oct 08 20:11:34 2017 +0200
> > 
> > @@ -70,6 +70,9 @@
> > 
> >  configitem('blackbox', 'logsource',
> > 
> >      default=False,
> > 
> >  )
> > 
> > +configitem('blackbox', 'track',
> > 
> > +    default=['*'],
> > 
> > +)
> 
> Should not use mutable value as default. See 77e666f943a6
> (configitems: support callable as a default value, 2017-06-28).
> Right?
> 
> The patch is pretty deep in the stack of queued commits, so I'll
> accept, but please send a followup.

You are definitely right! I just sent a followup, thank you for
catching it.
> > 
> >  lastui = None
> > 
> > 
> > 
> > @@ -121,7 +124,7 @@
> > 
> > 
> > 
> >          @util.propertycache
> > 
> >          def track(self):
> > 
> > -            return self.configlist('blackbox', 'track', ['*'])
> > 
> > +            return self.configlist('blackbox', 'track')
> > 
> > 
> > 
> >          def log(self, event, *msg, **opts):
> > 
> >              global lastui
> > 
> > _______________________________________________
> > 
> > Mercurial-devel mailing list
> > 
> > Mercurial-devel@mercurial-scm.org
> > 
> > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
> > 
> >

Patch

diff -r 8cef8f7d51d0 -r cdac8099d6c0 hgext/blackbox.py
--- a/hgext/blackbox.py	Thu Oct 05 20:41:50 2017 -0700
+++ b/hgext/blackbox.py	Sun Oct 08 20:11:34 2017 +0200
@@ -70,6 +70,9 @@ 
 configitem('blackbox', 'logsource',
     default=False,
 )
+configitem('blackbox', 'track',
+    default=['*'],
+)
 
 lastui = None
 
@@ -121,7 +124,7 @@ 
 
         @util.propertycache
         def track(self):
-            return self.configlist('blackbox', 'track', ['*'])
+            return self.configlist('blackbox', 'track')
 
         def log(self, event, *msg, **opts):
             global lastui