Patchwork configitems: fix registration for 'blackbox.track' config

login
register
mail settings
Submitter Boris Feld
Date Oct. 11, 2017, 1:42 p.m.
Message ID <0ae4811261aa53efb637.1507729341@FB>
Download mbox | patch
Permalink /patch/24733/
State Accepted
Headers show

Comments

Boris Feld - Oct. 11, 2017, 1:42 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1507728357 -7200
#      Wed Oct 11 15:25:57 2017 +0200
# Node ID 0ae4811261aa53efb6372572dae546fdd98b8f58
# Parent  4a6a337f9c682bdf1659295f871dc43ff33677ca
# EXP-Topic config.fixup.blackbox
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 0ae4811261aa
configitems: fix registration for 'blackbox.track' config

Default mutable values could be problematic. Use a lambda that returns the
value instead.

Thanks to martin for catching this bug.
Augie Fackler - Oct. 11, 2017, 3:58 p.m.
On Wed, Oct 11, 2017 at 03:42:21PM +0200, Boris Feld wrote:
> # HG changeset patch
> # User Boris Feld <boris.feld@octobus.net>
> # Date 1507728357 -7200
> #      Wed Oct 11 15:25:57 2017 +0200
> # Node ID 0ae4811261aa53efb6372572dae546fdd98b8f58
> # Parent  4a6a337f9c682bdf1659295f871dc43ff33677ca
> # EXP-Topic config.fixup.blackbox
> # Available At https://bitbucket.org/octobus/mercurial-devel/
> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 0ae4811261aa
> configitems: fix registration for 'blackbox.track' config

queued, thanks

Patch

diff --git a/hgext/blackbox.py b/hgext/blackbox.py
--- a/hgext/blackbox.py
+++ b/hgext/blackbox.py
@@ -71,7 +71,7 @@ 
     default=False,
 )
 configitem('blackbox', 'track',
-    default=['*'],
+    default=lambda: ['*'],
 )
 
 lastui = None