Patchwork D7082: fix: fix registration of config item defaults

login
register
mail settings
Submitter phabricator
Date Oct. 14, 2019, 5:10 p.m.
Message ID <8bcf72761ea65614cd024d4fbca63127@localhost.localdomain>
Download mbox | patch
Permalink /patch/42324/
State Not Applicable
Headers show

Comments

phabricator - Oct. 14, 2019, 5:10 p.m.
Closed by commit rHG5cb3e6f4e069: fix: fix registration of config item defaults (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7082?vs=17127&id=17140

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7082/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D7082

AFFECTED FILES
  hgext/fix.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/hgext/fix.py b/hgext/fix.py
--- a/hgext/fix.py
+++ b/hgext/fix.py
@@ -178,7 +178,7 @@ 
 }
 
 for key, default in FIXER_ATTRS.items():
-    configitem(b'fix', b'.*(:%s)?' % key, default=default, generic=True)
+    configitem(b'fix', b'.*:%s$' % key, default=default, generic=True)
 
 # A good default size allows most source code files to be fixed, but avoids
 # letting fixer tools choke on huge inputs, which could be surprising to the
@@ -794,12 +794,11 @@ 
     fixers = {}
     for name in fixernames(ui):
         fixers[name] = Fixer()
-        attrs = ui.configsuboptions(b'fix', name)[1]
         for key, default in FIXER_ATTRS.items():
             setattr(
                 fixers[name],
                 pycompat.sysstr(b'_' + key),
-                attrs.get(key, default),
+                ui.config(b'fix', name + b':' + key, default),
             )
         fixers[name]._priority = int(fixers[name]._priority)
         fixers[name]._metadata = stringutil.parsebool(fixers[name]._metadata)