diff rust/hg-core/src/errors.rs @ 46740:97ac588b6d9e

rhg: Don’t make repository path absolute too early Some error messages want to include a relative path, which affects the output of some tests. Differential Revision: https://phab.mercurial-scm.org/D10138
author Simon Sapin <simon.sapin@octobus.net>
date Mon, 08 Mar 2021 08:35:43 +0100
parents 12d59eec7f1d
children bcdcb4423ae3
line wrap: on
line diff
--- a/rust/hg-core/src/errors.rs	Fri Mar 05 13:28:49 2021 +0100
+++ b/rust/hg-core/src/errors.rs	Mon Mar 08 08:35:43 2021 +0100
@@ -50,6 +50,8 @@
         from: std::path::PathBuf,
         to: std::path::PathBuf,
     },
+    /// `std::fs::canonicalize`
+    CanonicalizingPath(std::path::PathBuf),
     /// `std::env::current_dir`
     CurrentDir,
     /// `std::env::current_exe`
@@ -128,6 +130,9 @@
                 from.display(),
                 to.display()
             ),
+            IoErrorContext::CanonicalizingPath(path) => {
+                write!(f, "when canonicalizing {}", path.display())
+            }
             IoErrorContext::CurrentDir => {
                 write!(f, "error getting current working directory")
             }