comparison tests/test-config.t @ 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
comparison
equal deleted inserted replaced
46420:4ae85340d5eb 46421:9d49ae51aa56
395 setup necessary file 395 setup necessary file
396 396
397 $ cat > file-A.rc << EOF 397 $ cat > file-A.rc << EOF
398 > [config-test] 398 > [config-test]
399 > basic = value-A 399 > basic = value-A
400 > pre-include= value-A
401 > %include ./included.rc
402 > post-include= value-A
400 > EOF 403 > EOF
401 404
402 $ cat > file-B.rc << EOF 405 $ cat > file-B.rc << EOF
403 > [config-test] 406 > [config-test]
404 > basic = value-B 407 > basic = value-B
405 > EOF 408 > EOF
406 409
410
411 $ cat > included.rc << EOF
412 > [config-test]
413 > pre-include= value-included
414 > post-include= value-included
415 > EOF
416
407 Simple order checking 417 Simple order checking
408 --------------------- 418 ---------------------
409 419
410 If file B is read after file A, value from B overwrite value from A. 420 If file B is read after file A, value from B overwrite value from A.
411 421
412 $ HGRCPATH="file-A.rc:file-B.rc" hg config config-test.basic 422 $ HGRCPATH="file-A.rc:file-B.rc" hg config config-test.basic
413 value-B 423 value-B
424
425 Ordering from include
426 ---------------------
427
428 value from an include overwrite value defined before the include, but not the one defined after the include
429
430 $ HGRCPATH="file-A.rc" hg config config-test.pre-include
431 value-included
432 $ HGRCPATH="file-A.rc" hg config config-test.post-include
433 value-A