rust/rhg/src/commands/cat.rs
changeset 48237 027ebad952ac
parent 48224 6b5773f89183
child 48308 698b70b9e8ea
--- a/rust/rhg/src/commands/cat.rs	Thu Oct 14 19:02:08 2021 +0100
+++ b/rust/rhg/src/commands/cat.rs	Fri Oct 15 14:05:20 2021 +0100
@@ -66,6 +66,7 @@
             .map_err(|e| CommandError::abort(e.to_string()))?;
         files.push(hg_file);
     }
+    let files = files.iter().map(|file| file.as_ref()).collect();
     // TODO probably move this to a util function like `repo.default_rev` or
     // something when it's used somewhere else
     let rev = match rev {
@@ -74,7 +75,9 @@
     };
 
     let output = cat(&repo, &rev, files).map_err(|e| (e, rev.as_str()))?;
-    invocation.ui.write_stdout(&output.concatenated)?;
+    for (_file, contents) in output.results {
+        invocation.ui.write_stdout(&contents)?;
+    }
     if !output.missing.is_empty() {
         let short = format!("{:x}", output.node.short()).into_bytes();
         for path in &output.missing {