From patchwork Wed Aug 7 13:51:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D6720: config: fix defaultvalue template keyword (patch 2 of 2) From: phabricator X-Patchwork-Id: 41195 Message-Id: To: Phabricator Cc: mercurial-devel@mercurial-scm.org Date: Wed, 7 Aug 2019 13:51:20 +0000 navaneeth.suresh created this revision. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This is a follow-up patch to rHG51a2e3102db2 . This moves `fm.data()` out of the if block in `commands.config()`. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D6720 AFFECTED FILES mercurial/commands.py tests/test-config.t CHANGE DETAILS To: navaneeth.suresh, #hg-reviewers Cc: mercurial-devel 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 @@ -1881,8 +1881,8 @@ continue fm.startitem() fm.condwrite(ui.debugflag, 'source', '%s: ', source) + fm.data(name=entryname, defaultvalue=defaultvalue) if uniquesel: - fm.data(name=entryname, defaultvalue=defaultvalue) fm.write('value', '%s\n', value) else: fm.write('name value', '%s=%s\n', entryname, value)