D6962: config: add defaults and experimental status for --debug flag

2020-01-24 Thread baymax (Baymax, Your Personal Patch-care Companion)
This revision now requires changes to proceed.
baymax added a comment.
baymax requested changes to this revision.


  There seems to have been no activities on this Diff for the past 3 Months.
  
  By policy, we are automatically moving it out of the `need-review` state.
  
  Please, move it back to `need-review` without hesitation if this diff should 
still be discussed.
  
  :baymax:need-review-idle:

REPOSITORY
  rHG Mercurial

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

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

To: navaneeth.suresh, #hg-reviewers, baymax
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


D6962: config: add defaults and experimental status for --debug flag

2019-10-04 Thread navaneeth.suresh (Navaneeth Suresh)
navaneeth.suresh created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  This patch adds `EXPERIMENTAL` to the output of 'showconfig --debug'
  for experimental flags which are not under the `section == 'experimental'`.
  This also adds the default value of the config item if it differs from
  the current value.

REPOSITORY
  rHG Mercurial

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

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

CHANGE DETAILS

diff --git a/tests/test-config.t b/tests/test-config.t
--- a/tests/test-config.t
+++ b/tests/test-config.t
@@ -972,3 +972,11 @@
   diff.showfunc=False
   diff.unified=None
   diff.word-diff=False
+
+  $ hg showconfig --debug --registered | grep 'cmdserver'
+  none: cmdserver.log=None
+  none: cmdserver.max-log-files=7
+  none: cmdserver.max-log-size=1 MB
+  none: cmdserver.max-repo-cache(EXPERIMENTAL)=0 (default: None)
+  none: cmdserver.message-encodings(EXPERIMENTAL)=[] (default: None)
+  none: cmdserver.track-log=[b'chgserver', b'cmdserver', b'repocache']
diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -833,6 +833,9 @@
 # --verbose is specified.
 continue
 value = self._config(section, name, untrusted=untrusted)
+if self.debugflag:
+if item.experimental or 'experimental' in name:
+name = ''.join([name, '(EXPERIMENTAL)'])
 yield section, name, value
 
 def plain(self, feature=None):
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -1890,7 +1890,12 @@
 fm.data(name=entryname)
 fm.write('value', '%s\n', value)
 else:
-fm.write('name value', '%s=%s\n', entryname, value)
+if (opts.get('registered') and
+value != pycompat.bytestr(defaultvalue) and ui.debugflag):
+fm.write('name value defaultvalue', '%s=%s (default: %s)\n',
+  entryname, value, pycompat.bytestr(defaultvalue))
+else:
+fm.write('name value', '%s=%s\n', entryname, value)
 matched = True
 fm.end()
 if matched:



To: navaneeth.suresh, #hg-reviewers
Cc: mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel