Show More
@@ -2202,6 +2202,7 b' def _docommit(ui, repo, *pats, **opts):' | |||||
2202 | (b'u', b'untrusted', None, _(b'show untrusted configuration options')), |
|
2202 | (b'u', b'untrusted', None, _(b'show untrusted configuration options')), | |
2203 | (b'e', b'edit', None, _(b'edit user config')), |
|
2203 | (b'e', b'edit', None, _(b'edit user config')), | |
2204 | (b'l', b'local', None, _(b'edit repository config')), |
|
2204 | (b'l', b'local', None, _(b'edit repository config')), | |
|
2205 | (b'', b'source', None, _(b'show source of configuration value')), | |||
2205 | ( |
|
2206 | ( | |
2206 | b'', |
|
2207 | b'', | |
2207 | b'shared', |
|
2208 | b'shared', | |
@@ -2232,7 +2233,7 b' def config(ui, repo, *values, **opts):' | |||||
2232 | --global, edit the system-wide config file. With --local, edit the |
|
2233 | --global, edit the system-wide config file. With --local, edit the | |
2233 | repository-level config file. |
|
2234 | repository-level config file. | |
2234 |
|
2235 | |||
2235 |
With -- |
|
2236 | With --source, the source (filename and line number) is printed | |
2236 | for each config item. |
|
2237 | for each config item. | |
2237 |
|
2238 | |||
2238 | See :hg:`help config` for more information about config files. |
|
2239 | See :hg:`help config` for more information about config files. | |
@@ -2335,6 +2336,7 b' def config(ui, repo, *values, **opts):' | |||||
2335 | selentries = set(selentries) |
|
2336 | selentries = set(selentries) | |
2336 |
|
2337 | |||
2337 | matched = False |
|
2338 | matched = False | |
|
2339 | show_source = ui.debugflag or opts.get(b'source') | |||
2338 | for section, name, value in ui.walkconfig(untrusted=untrusted): |
|
2340 | for section, name, value in ui.walkconfig(untrusted=untrusted): | |
2339 | source = ui.configsource(section, name, untrusted) |
|
2341 | source = ui.configsource(section, name, untrusted) | |
2340 | value = pycompat.bytestr(value) |
|
2342 | value = pycompat.bytestr(value) | |
@@ -2346,7 +2348,7 b' def config(ui, repo, *values, **opts):' | |||||
2346 | if values and not (section in selsections or entryname in selentries): |
|
2348 | if values and not (section in selsections or entryname in selentries): | |
2347 | continue |
|
2349 | continue | |
2348 | fm.startitem() |
|
2350 | fm.startitem() | |
2349 |
fm.condwrite( |
|
2351 | fm.condwrite(show_source, b'source', b'%s: ', source) | |
2350 | if uniquesel: |
|
2352 | if uniquesel: | |
2351 | fm.data(name=entryname) |
|
2353 | fm.data(name=entryname) | |
2352 | fm.write(b'value', b'%s\n', value) |
|
2354 | fm.write(b'value', b'%s\n', value) |
@@ -5,7 +5,7 b' Troubleshooting' | |||||
5 | =============== |
|
5 | =============== | |
6 |
|
6 | |||
7 | If you're having problems with your configuration, |
|
7 | If you're having problems with your configuration, | |
8 |
:hg:`config -- |
|
8 | :hg:`config --source` can help you understand what is introducing | |
9 | a setting into your environment. |
|
9 | a setting into your environment. | |
10 |
|
10 | |||
11 | See :hg:`help config.syntax` and :hg:`help config.files` |
|
11 | See :hg:`help config.syntax` and :hg:`help config.files` |
@@ -1,5 +1,8 b'' | |||||
1 | == New Features == |
|
1 | == New Features == | |
2 |
|
2 | |||
|
3 | * `hg config` now has a `--source` option to show where each | |||
|
4 | configuration value comes from. | |||
|
5 | ||||
3 |
|
6 | |||
4 | == Default Format Change == |
|
7 | == Default Format Change == | |
5 |
|
8 |
@@ -262,7 +262,7 b' Show all commands + options' | |||||
262 | cat: output, rev, decode, include, exclude, template |
|
262 | cat: output, rev, decode, include, exclude, template | |
263 | clone: noupdate, updaterev, rev, branch, pull, uncompressed, stream, ssh, remotecmd, insecure |
|
263 | clone: noupdate, updaterev, rev, branch, pull, uncompressed, stream, ssh, remotecmd, insecure | |
264 | commit: addremove, close-branch, amend, secret, edit, force-close-branch, interactive, include, exclude, message, logfile, date, user, subrepos |
|
264 | commit: addremove, close-branch, amend, secret, edit, force-close-branch, interactive, include, exclude, message, logfile, date, user, subrepos | |
265 | config: untrusted, edit, local, shared, non-shared, global, template |
|
265 | config: untrusted, edit, local, source, shared, non-shared, global, template | |
266 | continue: dry-run |
|
266 | continue: dry-run | |
267 | copy: forget, after, at-rev, force, include, exclude, dry-run |
|
267 | copy: forget, after, at-rev, force, include, exclude, dry-run | |
268 | debugancestor: |
|
268 | debugancestor: |
@@ -277,8 +277,7 b' Test empty config source:' | |||||
277 | > emptysource = `pwd`/emptysource.py |
|
277 | > emptysource = `pwd`/emptysource.py | |
278 | > EOF |
|
278 | > EOF | |
279 |
|
279 | |||
280 |
$ hg config -- |
|
280 | $ hg config --source empty.source | |
281 | read config from: * (glob) |
|
|||
282 | none: value |
|
281 | none: value | |
283 | $ hg config empty.source -Tjson |
|
282 | $ hg config empty.source -Tjson | |
284 | [ |
|
283 | [ | |
@@ -349,16 +348,16 b' edit failure' | |||||
349 |
|
348 | |||
350 | config affected by environment variables |
|
349 | config affected by environment variables | |
351 |
|
350 | |||
352 |
$ EDITOR=e1 VISUAL=e2 hg config -- |
|
351 | $ EDITOR=e1 VISUAL=e2 hg config --source | grep 'ui\.editor' | |
353 | $VISUAL: ui.editor=e2 |
|
352 | $VISUAL: ui.editor=e2 | |
354 |
|
353 | |||
355 |
$ VISUAL=e2 hg config -- |
|
354 | $ VISUAL=e2 hg config --source --config ui.editor=e3 | grep 'ui\.editor' | |
356 | --config: ui.editor=e3 |
|
355 | --config: ui.editor=e3 | |
357 |
|
356 | |||
358 |
$ PAGER=p1 hg config -- |
|
357 | $ PAGER=p1 hg config --source | grep 'pager\.pager' | |
359 | $PAGER: pager.pager=p1 |
|
358 | $PAGER: pager.pager=p1 | |
360 |
|
359 | |||
361 |
$ PAGER=p1 hg config -- |
|
360 | $ PAGER=p1 hg config --source --config pager.pager=p2 | grep 'pager\.pager' | |
362 | --config: pager.pager=p2 |
|
361 | --config: pager.pager=p2 | |
363 |
|
362 | |||
364 | verify that aliases are evaluated as well |
|
363 | verify that aliases are evaluated as well |
@@ -253,9 +253,8 b' source of paths is not mangled' | |||||
253 | > [paths] |
|
253 | > [paths] | |
254 | > foo = bar |
|
254 | > foo = bar | |
255 | > EOF |
|
255 | > EOF | |
256 |
$ hg showconfig -- |
|
256 | $ hg showconfig --source paths | |
257 | plain: True |
|
257 | plain: True | |
258 | read config from: $TESTTMP/hgrc |
|
|||
259 | $TESTTMP/hgrc:17: paths.foo=$TESTTMP/bar |
|
258 | $TESTTMP/hgrc:17: paths.foo=$TESTTMP/bar | |
260 |
|
259 | |||
261 | Test we can skip the user configuration |
|
260 | Test we can skip the user configuration |
@@ -101,7 +101,7 b' Hint if the cache location cannot be inf' | |||||
101 | #if windows |
|
101 | #if windows | |
102 | $ unset LOCALAPPDATA |
|
102 | $ unset LOCALAPPDATA | |
103 | $ unset APPDATA |
|
103 | $ unset APPDATA | |
104 |
$ HGRCPATH= hg config lfs -- |
|
104 | $ HGRCPATH= hg config lfs --source | |
105 | abort: unknown lfs usercache location |
|
105 | abort: unknown lfs usercache location | |
106 | (define LOCALAPPDATA or APPDATA in the environment, or set lfs.usercache) |
|
106 | (define LOCALAPPDATA or APPDATA in the environment, or set lfs.usercache) | |
107 | [255] |
|
107 | [255] | |
@@ -109,7 +109,7 b' Hint if the cache location cannot be inf' | |||||
109 |
|
109 | |||
110 | #if osx |
|
110 | #if osx | |
111 | $ unset HOME |
|
111 | $ unset HOME | |
112 |
$ HGRCPATH= hg config lfs -- |
|
112 | $ HGRCPATH= hg config lfs --source | |
113 | abort: unknown lfs usercache location |
|
113 | abort: unknown lfs usercache location | |
114 | (define HOME in the environment, or set lfs.usercache) |
|
114 | (define HOME in the environment, or set lfs.usercache) | |
115 | [255] |
|
115 | [255] | |
@@ -118,7 +118,7 b' Hint if the cache location cannot be inf' | |||||
118 | #if no-windows no-osx |
|
118 | #if no-windows no-osx | |
119 | $ unset XDG_CACHE_HOME |
|
119 | $ unset XDG_CACHE_HOME | |
120 | $ unset HOME |
|
120 | $ unset HOME | |
121 |
$ HGRCPATH= hg config lfs -- |
|
121 | $ HGRCPATH= hg config lfs --source | |
122 | abort: unknown lfs usercache location |
|
122 | abort: unknown lfs usercache location | |
123 | (define XDG_CACHE_HOME or HOME in the environment, or set lfs.usercache) |
|
123 | (define XDG_CACHE_HOME or HOME in the environment, or set lfs.usercache) | |
124 | [255] |
|
124 | [255] |
@@ -509,9 +509,8 b' Phabreading a DREV with a local:commits ' | |||||
509 |
|
509 | |||
510 | A bad .arcconfig doesn't error out |
|
510 | A bad .arcconfig doesn't error out | |
511 | $ echo 'garbage' > .arcconfig |
|
511 | $ echo 'garbage' > .arcconfig | |
512 |
$ hg config phabricator -- |
|
512 | $ hg config phabricator --source | |
513 | invalid JSON in $TESTTMP/repo/.arcconfig |
|
513 | invalid JSON in $TESTTMP/repo/.arcconfig | |
514 | read config from: */.hgrc (glob) |
|
|||
515 | */.hgrc:*: phabricator.debug=True (glob) |
|
514 | */.hgrc:*: phabricator.debug=True (glob) | |
516 | $TESTTMP/repo/.hg/hgrc:*: phabricator.url=https://phab.mercurial-scm.org/ (glob) |
|
515 | $TESTTMP/repo/.hg/hgrc:*: phabricator.url=https://phab.mercurial-scm.org/ (glob) | |
517 | $TESTTMP/repo/.hg/hgrc:*: phabricator.callsign=HG (glob) |
|
516 | $TESTTMP/repo/.hg/hgrc:*: phabricator.callsign=HG (glob) | |
@@ -524,8 +523,7 b' The .arcconfig content overrides global ' | |||||
524 | > EOF |
|
523 | > EOF | |
525 | $ cp $TESTDIR/../.arcconfig . |
|
524 | $ cp $TESTDIR/../.arcconfig . | |
526 | $ mv .hg/hgrc .hg/hgrc.bak |
|
525 | $ mv .hg/hgrc .hg/hgrc.bak | |
527 |
$ hg config phabricator -- |
|
526 | $ hg config phabricator --source | |
528 | read config from: */.hgrc (glob) |
|
|||
529 | */.hgrc:*: phabricator.debug=True (glob) |
|
527 | */.hgrc:*: phabricator.debug=True (glob) | |
530 | $TESTTMP/repo/.arcconfig: phabricator.callsign=HG |
|
528 | $TESTTMP/repo/.arcconfig: phabricator.callsign=HG | |
531 | $TESTTMP/repo/.arcconfig: phabricator.url=https://phab.mercurial-scm.org/ |
|
529 | $TESTTMP/repo/.arcconfig: phabricator.url=https://phab.mercurial-scm.org/ | |
@@ -536,8 +534,7 b" But it doesn't override local config" | |||||
536 | > url = local |
|
534 | > url = local | |
537 | > callsign = local |
|
535 | > callsign = local | |
538 | > EOF |
|
536 | > EOF | |
539 |
$ hg config phabricator -- |
|
537 | $ hg config phabricator --source | |
540 | read config from: */.hgrc (glob) |
|
|||
541 | */.hgrc:*: phabricator.debug=True (glob) |
|
538 | */.hgrc:*: phabricator.debug=True (glob) | |
542 | $TESTTMP/repo/.hg/hgrc:*: phabricator.url=local (glob) |
|
539 | $TESTTMP/repo/.hg/hgrc:*: phabricator.url=local (glob) | |
543 | $TESTTMP/repo/.hg/hgrc:*: phabricator.callsign=local (glob) |
|
540 | $TESTTMP/repo/.hg/hgrc:*: phabricator.callsign=local (glob) |
General Comments 0
You need to be logged in to leave comments.
Login now