Patchwork D9916: config: test priority involving include

login
register
mail settings
Submitter phabricator
Date Jan. 30, 2021, 1:39 a.m.
Message ID <differential-rev-PHID-DREV-xmsjk4nvohiwm6v6il7y-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48227/
State Superseded
Headers show

Comments

phabricator - Jan. 30, 2021, 1:39 a.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  tests/test-config.t

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-config.t b/tests/test-config.t
--- a/tests/test-config.t
+++ b/tests/test-config.t
@@ -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