rust/rhg/src/commands/status.rs
changeset 48467 0c408831b2f1
parent 48454 473af5cbc209
child 48471 b005d07ded7d
--- a/rust/rhg/src/commands/status.rs	Tue Dec 07 15:14:08 2021 +0100
+++ b/rust/rhg/src/commands/status.rs	Mon Dec 13 14:37:16 2021 +0100
@@ -237,8 +237,20 @@
         warn!("Pattern warnings: {:?}", &pattern_warnings);
     }
 
-    if !ds_status.bad.is_empty() {
-        warn!("Bad matches {:?}", &(ds_status.bad))
+    for (path, error) in ds_status.bad {
+        let error = match error {
+            hg::BadMatch::OsError(code) => {
+                std::io::Error::from_raw_os_error(code).to_string()
+            }
+            hg::BadMatch::BadType(ty) => {
+                format!("unsupported file type (type is {})", ty)
+            }
+        };
+        ui.write_stderr(&format_bytes!(
+            b"{}: {}\n",
+            path.as_bytes(),
+            error.as_bytes()
+        ))?
     }
     if !ds_status.unsure.is_empty() {
         info!(