diff -r 18b3060fe598 -r ed1583a845d2 rust/hg-core/src/dirstate_tree/on_disk.rs --- a/rust/hg-core/src/dirstate_tree/on_disk.rs Wed May 19 13:15:00 2021 +0200 +++ b/rust/hg-core/src/dirstate_tree/on_disk.rs Wed May 19 13:15:00 2021 +0200 @@ -109,7 +109,10 @@ } /// Unexpected file format found in `.hg/dirstate` with the "v2" format. -pub(crate) struct DirstateV2ParseError; +/// +/// This should only happen if Mercurial is buggy or a repository is corrupted. +#[derive(Debug)] +pub struct DirstateV2ParseError; impl From for HgError { fn from(_: DirstateV2ParseError) -> Self { @@ -295,9 +298,9 @@ // First accumulate serialized nodes in a `Vec` let mut on_disk_nodes = Vec::with_capacity(nodes.len()); for node in nodes { - let children = write_nodes(node.children(), out)?; - let full_path = write_slice::(node.full_path().as_bytes(), out); - let copy_source = if let Some(source) = node.copy_source() { + let children = write_nodes(node.children()?, out)?; + let full_path = write_slice::(node.full_path()?.as_bytes(), out); + let copy_source = if let Some(source) = node.copy_source()? { write_slice::(source.as_bytes(), out) } else { Slice {