diff rust/hg-core/src/repo.rs @ 47404: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 bd88b6bfd8da
children 88119fffecc8
line wrap: on
line diff
--- a/rust/hg-core/src/repo.rs	Mon Jun 07 17:10:35 2021 -0400
+++ b/rust/hg-core/src/repo.rs	Sun Apr 11 00:50:10 2021 +0530
@@ -53,7 +53,7 @@
     /// Having two methods would just move that `if` to almost all callers.
     pub fn find(
         config: &Config,
-        explicit_path: Option<&Path>,
+        explicit_path: Option<PathBuf>,
     ) -> Result<Self, RepoError> {
         if let Some(root) = explicit_path {
             if root.join(".hg").is_dir() {