D7627: config: drop debug messages saying where config was read from

martinvonz (Martin von Zweigbergk) phabricator at mercurial-scm.org
Thu Dec 12 23:45:57 UTC 2019


martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  `hg config --debug` includes lines like this:
  
    read config from: /etc/mercurial/hgrc.d/hgkpath.rc
    set config by: $EDITOR
  
  but also lines like this:
  
    /etc/mercurial/hgrc.d/hgkpath.rc:2: hgk.path=/usr/share/mercurial/hgk
    $EDITOR: ui.editor=emacs -nw
  
  The first type of output doesn't seem to provide much additional
  information over what we get from the second type. I could imagine
  wanting to see which values got overriden by a later entry, but that
  information is already not present. So let's just remove the first
  type of output. My next patch would otherwise amplify the redundant
  output.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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

CHANGE DETAILS

diff --git a/tests/test-hgrc.t b/tests/test-hgrc.t
--- a/tests/test-hgrc.t
+++ b/tests/test-hgrc.t
@@ -170,7 +170,6 @@
 customized hgrc
 
   $ hg showconfig
-  read config from: $TESTTMP/hgrc
   $TESTTMP/hgrc:13: alias.log=log -g
   repo: bundle.mainreporoot=$TESTTMP
   $TESTTMP/hgrc:11: defaults.identify=-n
@@ -187,7 +186,6 @@
 
   $ HGPLAIN=; export HGPLAIN
   $ hg showconfig --config ui.traceback=True --debug
-  read config from: $TESTTMP/hgrc
   repo: bundle.mainreporoot=$TESTTMP
   --config: ui.traceback=True
   --verbose: ui.verbose=False
@@ -197,10 +195,6 @@
 with environment variables
 
   $ PAGER=p1 EDITOR=e1 VISUAL=e2 hg showconfig --debug
-  set config by: $EDITOR
-  set config by: $VISUAL
-  set config by: $PAGER
-  read config from: $TESTTMP/hgrc
   repo: bundle.mainreporoot=$TESTTMP
   $PAGER: pager.pager=p1
   $VISUAL: ui.editor=e2
@@ -223,7 +217,6 @@
   $ HGPLAINEXCEPT=; export HGPLAINEXCEPT
   $ hg showconfig --config ui.traceback=True --debug
   plain: True
-  read config from: $TESTTMP/hgrc
   repo: bundle.mainreporoot=$TESTTMP
   $TESTTMP/hgrc:15: extensions.plain=./plain.py
   --config: ui.traceback=True
@@ -233,7 +226,6 @@
   $ unset HGPLAIN
   $ hg showconfig --config ui.traceback=True --debug
   plain: True
-  read config from: $TESTTMP/hgrc
   repo: bundle.mainreporoot=$TESTTMP
   $TESTTMP/hgrc:15: extensions.plain=./plain.py
   --config: ui.traceback=True
@@ -243,7 +235,6 @@
   $ HGPLAINEXCEPT=i18n; export HGPLAINEXCEPT
   $ hg showconfig --config ui.traceback=True --debug
   plain: True
-  read config from: $TESTTMP/hgrc
   repo: bundle.mainreporoot=$TESTTMP
   $TESTTMP/hgrc:15: extensions.plain=./plain.py
   --config: ui.traceback=True
@@ -259,5 +250,4 @@
   > EOF
   $ hg showconfig --debug paths
   plain: True
-  read config from: $TESTTMP/hgrc
   $TESTTMP/hgrc:17: paths.foo=$TESTTMP/bar
diff --git a/tests/test-config.t b/tests/test-config.t
--- a/tests/test-config.t
+++ b/tests/test-config.t
@@ -266,7 +266,6 @@
   > EOF
 
   $ hg config --debug empty.source
-  read config from: * (glob)
   none: value
   $ hg config empty.source -Tjson
   [
diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -2228,14 +2228,6 @@
         return
     ui.pager(b'config')
     fm = ui.formatter(b'config', opts)
-    for t, f in rcutil.rccomponents():
-        if t == b'path':
-            ui.debug(b'read config from: %s\n' % f)
-        elif t == b'items':
-            for section, name, value, source in f:
-                ui.debug(b'set config by: %s\n' % source)
-        else:
-            raise error.ProgrammingError(b'unknown rctype: %s' % t)
     untrusted = bool(opts.get(b'untrusted'))
 
     selsections = selentries = []



To: martinvonz, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list