Patchwork D9919: config: test priority involving alias and include

login
register
mail settings
Submitter phabricator
Date Jan. 30, 2021, 1:39 a.m.
Message ID <differential-rev-PHID-DREV-26h6nbqel2vxixrajus5-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48230/
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/D9919

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
@@ -418,6 +418,29 @@ 
   > post-include= value-included
   > EOF
 
+  $ cat > file-C.rc << EOF
+  > %include ./included-alias-C.rc
+  > [ui]
+  > logtemplate = "value-C\n"
+  > EOF
+
+  $ cat > included-alias-C.rc << EOF
+  > [command-templates]
+  > log = "value-included\n"
+  > EOF
+
+
+  $ cat > file-D.rc << EOF
+  > [command-templates]
+  > log = "value-D\n"
+  > %include ./included-alias-D.rc
+  > EOF
+
+  $ cat > included-alias-D.rc << EOF
+  > [ui]
+  > logtemplate = "value-included\n"
+  > EOF
+
 Simple order checking
 ---------------------
 
@@ -456,3 +479,15 @@ 
   $ HGRCPATH="file-A.rc:file-B.rc" hg log -r .
   value-A (known-bad-output !)
   value-B (missing-correct-output !)
+
+Alias and include
+-----------------
+
+The pre/post include priority should also apply when tie-breaking alternatives.
+
+  $ HGRCPATH="file-C.rc" hg log -r .
+  value-included (known-bad-output !)
+  value-C (missing-correct-output !)
+  $ HGRCPATH="file-D.rc" hg log -r .
+  value-D (known-bad-output !)
+  value-included (missing-correct-output !)