changeset 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 28a54c128e82
children 6cd9f53aaed8
files rust/hg-core/src/repo.rs
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-core/src/repo.rs	Wed Mar 03 18:40:17 2021 +0100
+++ b/rust/hg-core/src/repo.rs	Wed Mar 03 18:43:05 2021 +0100
@@ -58,9 +58,9 @@
         if let Some(root) = explicit_path {
             // Having an absolute path isn’t necessary here but can help code
             // elsewhere
-            let root = current_dir()?.join(root);
-            if root.join(".hg").is_dir() {
-                Self::new_at_path(root, config)
+            let absolute_root = current_dir()?.join(root);
+            if absolute_root.join(".hg").is_dir() {
+                Self::new_at_path(absolute_root, config)
             } else {
                 Err(RepoError::NotFound {
                     at: root.to_owned(),