Details
Details
- Reviewers
pulkit - Group Reviewers
hg-reviewers - Commits
- rHG9d49ae51aa56: config: test priority involving include
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
| pulkit |
| hg-reviewers |
| No Linters Available |
| No Unit Test Coverage |
| Path | Packages | |||
|---|---|---|---|---|
| M | tests/test-config.t (20 lines) |
| Commit | Parents | Author | Summary | Date |
|---|---|---|---|---|
| 4616e95f6ecf | 554936216f7d | Pierre-Yves David | Jan 29 2021, 5:50 AM |
| Configuration priority | Configuration priority | ||||
| ====================== | ====================== | ||||
| setup necessary file | setup necessary file | ||||
| $ cat > file-A.rc << EOF | $ cat > file-A.rc << EOF | ||||
| > [config-test] | > [config-test] | ||||
| > basic = value-A | > basic = value-A | ||||
| > pre-include= value-A | |||||
| > %include ./included.rc | |||||
| > post-include= value-A | |||||
| > EOF | > EOF | ||||
| $ cat > file-B.rc << EOF | $ cat > file-B.rc << EOF | ||||
| > [config-test] | > [config-test] | ||||
| > basic = value-B | > basic = value-B | ||||
| > EOF | > EOF | ||||
| $ cat > included.rc << EOF | |||||
| > [config-test] | |||||
| > pre-include= value-included | |||||
| > post-include= value-included | |||||
| > EOF | |||||
| Simple order checking | Simple order checking | ||||
| --------------------- | --------------------- | ||||
| If file B is read after file A, value from B overwrite value from A. | 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 | $ HGRCPATH="file-A.rc:file-B.rc" hg config config-test.basic | ||||
| value-B | 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 | |||||