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

login
register
mail settings
Submitter phabricator
Date Dec. 12, 2019, 11:45 p.m.
Message ID <differential-rev-PHID-DREV-tvqfppnfwwm3h2riww7d-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/43771/
State Superseded
Headers show

Comments

phabricator - Dec. 12, 2019, 11:45 p.m.
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




To: martinvonz, #hg-reviewers
Cc: mercurial-devel
phabricator - Dec. 13, 2019, 4:29 a.m.
mharbison72 added a comment.


  On Windows, you can set a registry key to one or more *.ini files or directories that get read in, so it seems slightly handy to know the order in which files are processed.  I know I've used that mechanism on various systems to find directories in which to stash things too.
  
  That said, I don't think I feel strongly about keeping it if it makes the next patch messy.  (I did a quick skim of it, but didn't see why that would be.)

REPOSITORY
  rHG Mercurial

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

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

To: martinvonz, #hg-reviewers
Cc: mharbison72, mercurial-devel
phabricator - Dec. 13, 2019, 5:28 a.m.
martinvonz added a comment.


  In D7627#112220 <https://phab.mercurial-scm.org/D7627#112220>, @mharbison72 wrote:
  
  > On Windows, you can set a registry key to one or more *.ini files or directories that get read in, so it seems slightly handy to know the order in which files are processed.  I know I've used that mechanism on various systems to find directories in which to stash things too.
  > That said, I don't think I feel strongly about keeping it if it makes the next patch messy.  (I did a quick skim of it, but didn't see why that would be.)
  
  It means that every line in merge-tools.rc would get two lines in this output (one line saying "set value from ..." or something like that).

REPOSITORY
  rHG Mercurial

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

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

To: martinvonz, #hg-reviewers
Cc: mharbison72, mercurial-devel
phabricator - Dec. 13, 2019, 8:02 a.m.
martinvonz added a comment.


  In D7627#112223 <https://phab.mercurial-scm.org/D7627#112223>, @martinvonz wrote:
  
  > In D7627#112220 <https://phab.mercurial-scm.org/D7627#112220>, @mharbison72 wrote:
  >
  >> On Windows, you can set a registry key to one or more *.ini files or directories that get read in, so it seems slightly handy to know the order in which files are processed.  I know I've used that mechanism on various systems to find directories in which to stash things too.
  >> That said, I don't think I feel strongly about keeping it if it makes the next patch messy.  (I did a quick skim of it, but didn't see why that would be.)
  >
  > It means that every line in merge-tools.rc would get two lines in this output (one line saying "set value from ..." or something like that).
  
  I'm also happy to drop just the "set item" lines. Better?

REPOSITORY
  rHG Mercurial

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

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

To: martinvonz, #hg-reviewers
Cc: mharbison72, mercurial-devel
phabricator - Dec. 14, 2019, 2:47 a.m.
mharbison72 added a comment.


  In D7627#112373 <https://phab.mercurial-scm.org/D7627#112373>, @martinvonz wrote:
  
  > In D7627#112223 <https://phab.mercurial-scm.org/D7627#112223>, @martinvonz wrote:
  >
  >> In D7627#112220 <https://phab.mercurial-scm.org/D7627#112220>, @mharbison72 wrote:
  >>
  >>> On Windows, you can set a registry key to one or more *.ini files or directories that get read in, so it seems slightly handy to know the order in which files are processed.  I know I've used that mechanism on various systems to find directories in which to stash things too.
  >>> That said, I don't think I feel strongly about keeping it if it makes the next patch messy.  (I did a quick skim of it, but didn't see why that would be.)
  >>
  >> It means that every line in merge-tools.rc would get two lines in this output (one line saying "set value from ..." or something like that).
  >
  > I'm also happy to drop just the "set item" lines. Better?
  
  I think so, thanks.
  
  One of the last hunks dropped here mentions "set by $EDITOR", but then never mentions EDITOR again.  That seems confusing if you don't know what that setting applies to and the precedence rules, and not real helpful if you do.

REPOSITORY
  rHG Mercurial

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

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

To: martinvonz, #hg-reviewers
Cc: mharbison72, mercurial-devel
phabricator - Dec. 16, 2019, 11:31 p.m.
martinvonz added a comment.


  In D7627#112577 <https://phab.mercurial-scm.org/D7627#112577>, @mharbison72 wrote:
  
  > In D7627#112373 <https://phab.mercurial-scm.org/D7627#112373>, @martinvonz wrote:
  >
  >> In D7627#112223 <https://phab.mercurial-scm.org/D7627#112223>, @martinvonz wrote:
  >>
  >>> In D7627#112220 <https://phab.mercurial-scm.org/D7627#112220>, @mharbison72 wrote:
  >>>
  >>>> On Windows, you can set a registry key to one or more *.ini files or directories that get read in, so it seems slightly handy to know the order in which files are processed.  I know I've used that mechanism on various systems to find directories in which to stash things too.
  >>>> That said, I don't think I feel strongly about keeping it if it makes the next patch messy.  (I did a quick skim of it, but didn't see why that would be.)
  >>>
  >>> It means that every line in merge-tools.rc would get two lines in this output (one line saying "set value from ..." or something like that).
  >>
  >> I'm also happy to drop just the "set item" lines. Better?
  >
  > I think so, thanks.
  > One of the last hunks dropped here mentions "set by $EDITOR", but then never mentions EDITOR again.  That seems confusing if you don't know what that setting applies to and the precedence rules, and not real helpful if you do.
  
  Okay, will upload an update that adds back the `read config from:` lines a few minutes.

REPOSITORY
  rHG Mercurial

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

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

To: martinvonz, #hg-reviewers
Cc: mharbison72, mercurial-devel
phabricator - Dec. 17, 2019, 11:45 a.m.
pulkit added a comment.


  After recent iteration, commit message needs to be reworked. Maybe I am biased because I know what the old version was and is still parsing the commit message that way.

REPOSITORY
  rHG Mercurial

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

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

To: martinvonz, #hg-reviewers
Cc: pulkit, mharbison72, mercurial-devel
phabricator - Dec. 17, 2019, 2:13 p.m.
martinvonz added a comment.


  In D7627#112962 <https://phab.mercurial-scm.org/D7627#112962>, @pulkit wrote:
  
  > After recent iteration, commit message needs to be reworked. Maybe I am biased because I know what the old version was and is still parsing the commit message that way.
  
  I did rework the message, but can see that mentioning the `read config from:` lines is now misleading. I'll remove that.

REPOSITORY
  rHG Mercurial

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

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

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

Patch

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 = []