Patchwork D10100: rhg: Print non-absolutized path in "repository {} not found" errors

login
register
mail settings
Submitter phabricator
Date March 3, 2021, 6:24 p.m.
Message ID <differential-rev-PHID-DREV-72pgfitrstbke2k2lyjt-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48415/
State Superseded
Headers show

Comments

phabricator - March 3, 2021, 6:24 p.m.
SimonSapin created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  … like Python does

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D10100

AFFECTED FILES
  rust/hg-core/src/repo.rs

CHANGE DETAILS




To: SimonSapin, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/rust/hg-core/src/repo.rs b/rust/hg-core/src/repo.rs
--- a/rust/hg-core/src/repo.rs
+++ b/rust/hg-core/src/repo.rs
@@ -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(),