Patchwork D6720: config: fix fm.data() handling of defaultvalue

login
register
mail settings
Submitter phabricator
Date Aug. 7, 2019, 9:32 p.m.
Message ID <9ac8eaa02aa9cfffdf7f7a6a5522666f@localhost.localdomain>
Download mbox | patch
Permalink /patch/41200/
State Not Applicable
Headers show

Comments

phabricator - Aug. 7, 2019, 9:32 p.m.
Closed by commit rHG60789444acd6: config: fix fm.data() handling of defaultvalue (authored by navaneeth.suresh).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6720?vs=16150&id=16152

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

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

AFFECTED FILES
  mercurial/commands.py
  tests/test-config.t

CHANGE DETAILS




To: navaneeth.suresh, #hg-reviewers, pulkit
Cc: pulkit, mercurial-devel

Patch

diff --git a/tests/test-config.t b/tests/test-config.t
--- a/tests/test-config.t
+++ b/tests/test-config.t
@@ -57,11 +57,13 @@ 
   $ hg showconfig Section -Tjson
   [
    {
+    "defaultvalue": null,
     "name": "Section.KeY",
     "source": "*.hgrc:*", (glob)
     "value": "Case Sensitive"
    },
    {
+    "defaultvalue": null,
     "name": "Section.key",
     "source": "*.hgrc:*", (glob)
     "value": "lower case"
@@ -77,8 +79,8 @@ 
    }
   ]
   $ hg showconfig -Tjson | tail -7
-   },
    {
+    "defaultvalue": null,
     "name": "*", (glob)
     "source": "*", (glob)
     "value": "*" (glob)
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1882,10 +1882,11 @@ 
         fm.startitem()
         fm.condwrite(ui.debugflag, 'source', '%s: ', source)
         if uniquesel:
-            fm.data(name=entryname, defaultvalue=defaultvalue)
+            fm.data(name=entryname)
             fm.write('value', '%s\n', value)
         else:
             fm.write('name value', '%s=%s\n', entryname, value)
+        fm.data(defaultvalue=defaultvalue)
         matched = True
     fm.end()
     if matched: