D6730: config: handle default values of type list

navaneeth.suresh (Navaneeth Suresh) phabricator at mercurial-scm.org
Fri Aug 16 05:03:46 EDT 2019


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

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):



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


More information about the Mercurial-devel mailing list