rust/rhg/src/commands/status.rs
branchstable
changeset 50225 53ca3e3bc013
parent 50215 ae61851e6fe2
child 50226 8fcd5302243a
--- a/rust/rhg/src/commands/status.rs	Sat Feb 25 06:11:14 2023 +0100
+++ b/rust/rhg/src/commands/status.rs	Mon Feb 27 15:18:50 2023 +0100
@@ -436,9 +436,21 @@
                     // `unsure_is_clean` which was needed before reading
                     // contents. Here we access metadata again after reading
                     // content, in case it changed in the meantime.
-                    let fs_metadata = repo
+                    let metadata_res = repo
                         .working_directory_vfs()
-                        .symlink_metadata(&fs_path)?;
+                        .symlink_metadata(&fs_path);
+                    let fs_metadata = match metadata_res {
+                        Ok(meta) => meta,
+                        Err(err) => match err {
+                            HgError::IoError { .. } => {
+                                // The file has probably been deleted. In any
+                                // case, it was in the dirstate before, so
+                                // let's ignore the error.
+                                continue;
+                            }
+                            _ => return Err(err.into()),
+                        },
+                    };
                     if let Some(mtime) =
                         TruncatedTimestamp::for_reliable_mtime_of(
                             &fs_metadata,