diff rust/rhg/src/commands/files.rs @ 46753: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 c184b490da37
children 63bfcddddac1
line wrap: on
line diff
--- a/rust/rhg/src/commands/files.rs	Fri Mar 05 13:28:49 2021 +0100
+++ b/rust/rhg/src/commands/files.rs	Mon Mar 08 08:35:43 2021 +0100
@@ -4,6 +4,7 @@
 use hg::operations::list_rev_tracked_files;
 use hg::operations::Dirstate;
 use hg::repo::Repo;
+use hg::utils::current_dir;
 use hg::utils::files::{get_bytes_from_path, relativize_path};
 use hg::utils::hg_path::{HgPath, HgPathBuf};
 
@@ -53,8 +54,10 @@
     files: impl IntoIterator<Item = &'a HgPath>,
 ) -> Result<(), CommandError> {
     let cwd = HgPathBuf::from(get_bytes_from_path(hg::utils::current_dir()?));
+    let working_directory = repo.working_directory_path();
+    let working_directory = current_dir()?.join(working_directory); // Make it absolute
     let working_directory =
-        HgPathBuf::from(get_bytes_from_path(repo.working_directory_path()));
+        HgPathBuf::from(get_bytes_from_path(working_directory));
 
     let mut stdout = ui.stdout_buffer();