changeset 46421:9d49ae51aa56

config: test priority involving include Differential Revision: https://phab.mercurial-scm.org/D9916
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 29 Jan 2021 11:50:33 +0100
parents 4ae85340d5eb
children 821775843caf
files tests/test-config.t
diffstat 1 files changed, 20 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-config.t	Fri Jan 29 11:42:27 2021 +0100
+++ b/tests/test-config.t	Fri Jan 29 11:50:33 2021 +0100
@@ -397,6 +397,9 @@
   $ cat > file-A.rc << EOF
   > [config-test]
   > basic = value-A
+  > pre-include= value-A
+  > %include ./included.rc
+  > post-include= value-A
   > EOF
 
   $ cat > file-B.rc << EOF
@@ -404,6 +407,13 @@
   > basic = value-B
   > EOF
 
+
+  $ cat > included.rc << EOF
+  > [config-test]
+  > pre-include= value-included
+  > post-include= value-included
+  > EOF
+
 Simple order checking
 ---------------------
 
@@ -411,3 +421,13 @@
 
   $ HGRCPATH="file-A.rc:file-B.rc" hg config config-test.basic
   value-B
+
+Ordering from include
+---------------------
+
+value from an include overwrite value defined before the include, but not the one defined after the include
+
+  $ HGRCPATH="file-A.rc" hg config config-test.pre-include
+  value-included
+  $ HGRCPATH="file-A.rc" hg config config-test.post-include
+  value-A