Patchwork D6730: config: handle default values of type list

login
register
mail settings
Submitter phabricator
Date Aug. 16, 2019, 9:03 a.m.
Message ID <differential-rev-PHID-DREV-ked3q67gz2lixduk6yie-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/41307/
State Superseded
Headers show

Comments

phabricator - Aug. 16, 2019, 9:03 a.m.
navaneeth.suresh created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This patch improves the output of the `defaultvalue` keyword.
  For example, `progress.format`.
  Its default value is shown to be `['topic', 'bar', 'number', 'estimate']`
  until now, but it does not match `hg help config.progress.format`
  (it says `default: topic bar number estimate`), and that is also not the
  format that users would need to use for the actual value in `hgrc` or using
  `--config` flag.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  mercurial/ui.py

CHANGE DETAILS




To: navaneeth.suresh, #hg-reviewers
Cc: mercurial-devel
phabricator - Aug. 17, 2019, 1 p.m.
This revision now requires changes to proceed.
av6 added a comment.
av6 requested changes to this revision.


  The changes in tests that this patch causes are actually already present in the D6709 <https://phab.mercurial-scm.org/D6709>, so let's fold this patch into it as well.

REPOSITORY
  rHG Mercurial

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

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

To: navaneeth.suresh, #hg-reviewers, av6
Cc: av6, mercurial-devel
phabricator - Aug. 17, 2019, 2:56 p.m.
navaneeth.suresh added a comment.
navaneeth.suresh abandoned this revision.


  In D6730#98852 <https://phab.mercurial-scm.org/D6730#98852>, @av6 wrote:
  
  > The changes in tests that this patch causes are actually already present in the D6709 <https://phab.mercurial-scm.org/D6709>, so let's fold this patch into it as well.
  
  Okay. Folded and updated D6709 <https://phab.mercurial-scm.org/D6709>. Abandoning this.

REPOSITORY
  rHG Mercurial

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

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

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

Patch

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -792,6 +792,8 @@ 
                 itemdefault = item.default()
             else:
                 itemdefault = item.default
+            if itemdefault and isinstance(itemdefault, list):
+                itemdefault = ' '.join(itemdefault)
         return itemdefault
 
     def hasconfig(self, section, name, untrusted=False):