comparison rust/hg-core/src/repo.rs @ 46728:562a676e255a

rhg: Print non-absolutized path in "repository {} not found" errors ? like Python does. Differences in ouput can cause tests to fail. Differential Revision: https://phab.mercurial-scm.org/D10100
author Simon Sapin <simon.sapin@octobus.net>
date Wed, 03 Mar 2021 18:43:05 +0100
parents e8cd519a0a34
children dfd35823635b
comparison
equal deleted inserted replaced
46727:28a54c128e82 46728:562a676e255a
56 explicit_path: Option<&Path>, 56 explicit_path: Option<&Path>,
57 ) -> Result<Self, RepoError> { 57 ) -> Result<Self, RepoError> {
58 if let Some(root) = explicit_path { 58 if let Some(root) = explicit_path {
59 // Having an absolute path isn’t necessary here but can help code 59 // Having an absolute path isn’t necessary here but can help code
60 // elsewhere 60 // elsewhere
61 let root = current_dir()?.join(root); 61 let absolute_root = current_dir()?.join(root);
62 if root.join(".hg").is_dir() { 62 if absolute_root.join(".hg").is_dir() {
63 Self::new_at_path(root, config) 63 Self::new_at_path(absolute_root, config)
64 } else { 64 } else {
65 Err(RepoError::NotFound { 65 Err(RepoError::NotFound {
66 at: root.to_owned(), 66 at: root.to_owned(),
67 }) 67 })
68 } 68 }