annotate rust/hg-core/src/config.rs @ 47410:ebdef6283798

rhg: read [paths] for `--repository` value hg parses `-R` and `--repository` CLI arguments "early" in order to know which local repository to load config from. (Config can then affect whether or how to fall back.) The value of of those arguments can be not only a filesystem path, but also an alias configured in the `[paths]` section. This part was missing in rhg and this patch implements that. The current patch still lacks functionality to read config of current repository if we are not at root of repo. That will be fixed in upcoming patches. A new crate `home` is added to get path of home directory. Differential Revision: https://phab.mercurial-scm.org/D10296
author Pulkit Goyal <7895pulkit@gmail.com>
date Sun, 11 Apr 2021 00:50:10 +0530
parents a687a7f27951
children 39c447e03dbc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
46187
95d6f31e88db hg-core: add basic config module
Rapha?l Gom?s <rgomes@octobus.net>
parents:
diff changeset
1 // config.rs
95d6f31e88db hg-core: add basic config module
Rapha?l Gom?s <rgomes@octobus.net>
parents:
diff changeset
2 //
95d6f31e88db hg-core: add basic config module
Rapha?l Gom?s <rgomes@octobus.net>
parents:
diff changeset
3 // Copyright 2020
95d6f31e88db hg-core: add basic config module
Rapha?l Gom?s <rgomes@octobus.net>
parents:
diff changeset
4 // Valentin Gatien-Baron,
95d6f31e88db hg-core: add basic config module
Rapha?l Gom?s <rgomes@octobus.net>
parents:
diff changeset
5 // Raphaël Gomès <rgomes@octobus.net>
95d6f31e88db hg-core: add basic config module
Rapha?l Gom?s <rgomes@octobus.net>
parents:
diff changeset
6 //
95d6f31e88db hg-core: add basic config module
Rapha?l Gom?s <rgomes@octobus.net>
parents:
diff changeset
7 // This software may be used and distributed according to the terms of the
95d6f31e88db hg-core: add basic config module
Rapha?l Gom?s <rgomes@octobus.net>
parents:
diff changeset
8 // GNU General Public License version 2 or any later version.
95d6f31e88db hg-core: add basic config module
Rapha?l Gom?s <rgomes@octobus.net>
parents:
diff changeset
9
95d6f31e88db hg-core: add basic config module
Rapha?l Gom?s <rgomes@octobus.net>
parents:
diff changeset
10 //! Mercurial config parsing and interfaces.
95d6f31e88db hg-core: add basic config module
Rapha?l Gom?s <rgomes@octobus.net>
parents:
diff changeset
11
95d6f31e88db hg-core: add basic config module
Rapha?l Gom?s <rgomes@octobus.net>
parents:
diff changeset
12 mod config;
95d6f31e88db hg-core: add basic config module
Rapha?l Gom?s <rgomes@octobus.net>
parents:
diff changeset
13 mod layer;
46641
a687a7f27951 rust: Move config value parsing functions to a new module
Simon Sapin <simon.sapin@octobus.net>
parents: 46637
diff changeset
14 mod values;
47410
ebdef6283798 rhg: read [paths] for `--repository` value
Pulkit Goyal <7895pulkit@gmail.com>
parents: 46641
diff changeset
15 pub use config::{Config, ConfigSource, ConfigValueParseError};
46542
2845892dd489 rust: Parse system and user configuration
Simon Sapin <simon.sapin@octobus.net>
parents: 46187
diff changeset
16 pub use layer::{ConfigError, ConfigParseError};