Mercurial > public > mercurial-scm > hg
diff rust/rhg/src/main.rs @ 47405:88119fffecc8
rhg: look for repository in ancestors also instead of cwd only
Last patch introduced config reading at startup to parse value of `--repository`
flag. However, that patch only tried to check for current repository at current
working directory and not it's ancestors. This patch fixes that.
Differential Revision: https://phab.mercurial-scm.org/D10767
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Mon, 24 May 2021 16:27:54 +0530 |
parents | ebdef6283798 |
children | 3237ed4dcda4 |
line wrap: on
line diff
--- a/rust/rhg/src/main.rs Sun Apr 11 00:50:10 2021 +0530 +++ b/rust/rhg/src/main.rs Mon May 24 16:27:54 2021 +0530 @@ -174,9 +174,8 @@ } else { let local_config = { if std::env::var_os("HGRCSKIPREPO").is_none() { - let current_dir = hg::utils::current_dir(); - // TODO: handle errors from current_dir - if let Ok(current_dir_path) = current_dir { + // TODO: handle errors from find_repo_root + if let Ok(current_dir_path) = Repo::find_repo_root() { let config_files = vec![ ConfigSource::AbsPath( current_dir_path.join(".hg/hgrc"),