Mercurial > hg
changeset 46615:377689cc295f
config: test priority involving alias
Differential Revision: https://phab.mercurial-scm.org/D9918
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Fri, 29 Jan 2021 12:02:28 +0100 |
parents | a069639783a0 |
children | 702bb73d7330 |
files | tests/test-config.t |
diffstat | 1 files changed, 25 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test-config.t Thu Feb 25 21:25:04 2021 +0100 +++ b/tests/test-config.t Fri Jan 29 12:02:28 2021 +0100 @@ -400,11 +400,15 @@ > pre-include= value-A > %include ./included.rc > post-include= value-A + > [command-templates] + > log = "value-A\n" > EOF $ cat > file-B.rc << EOF > [config-test] > basic = value-B + > [ui] + > logtemplate = "value-B\n" > EOF @@ -437,3 +441,24 @@ $ HGRCPATH="file-A.rc:file-B.rc" hg config config-test.basic --config config-test.basic=value-CLI value-CLI + +Alias ordering +-------------- + +The official config is now `command-templates.log`, the historical +`ui.logtemplate` is a valid alternative for it. + +When both are defined, The config value read the last "win", this should keep +being true if the config have other alias. In other word, the config value read +earlier will be considered "lower level" and the config read later would be +considered "higher level". And higher level values wins. + +BROKEN: currently not the case. + + $ HGRCPATH="file-A.rc" hg log -r . + value-A + $ HGRCPATH="file-B.rc" hg log -r . + value-B + $ HGRCPATH="file-A.rc:file-B.rc" hg log -r . + value-A (known-bad-output !) + value-B (missing-correct-output !)