changeset 46420:4ae85340d5eb

config: add a test for priority when includes are involved Differential Revision: https://phab.mercurial-scm.org/D9915
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 29 Jan 2021 11:42:27 +0100
parents 6894c9ef4dcd
children 9d49ae51aa56
files tests/test-config.t
diffstat 1 files changed, 23 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-config.t	Fri Jan 29 16:26:53 2021 -0800
+++ b/tests/test-config.t	Fri Jan 29 11:42:27 2021 +0100
@@ -388,3 +388,26 @@
   > done
   $ HGRCPATH=configs hg config section.key
   99
+
+Configuration priority
+======================
+
+setup necessary file
+
+  $ cat > file-A.rc << EOF
+  > [config-test]
+  > basic = value-A
+  > EOF
+
+  $ cat > file-B.rc << EOF
+  > [config-test]
+  > basic = value-B
+  > EOF
+
+Simple order checking
+---------------------
+
+If file B is read after file A, value from B overwrite value from A.
+
+  $ HGRCPATH="file-A.rc:file-B.rc" hg config config-test.basic
+  value-B