# HG changeset patch # User Raphaël Gomès # Date 1726561112 -7200 # Node ID 09ece563609aecdd8b9282047218ae204a806eb3 # Parent 0604673428b777cbe23a43bc6a792006a827c34a rust-revlog: don't try to open the data file if the index is empty This will cover the case where the data file is not present. diff -r 0604673428b7 -r 09ece563609a rust/hg-core/src/revlog/mod.rs --- a/rust/hg-core/src/revlog/mod.rs Wed Jun 19 12:25:12 2024 +0200 +++ b/rust/hg-core/src/revlog/mod.rs Tue Sep 17 10:18:32 2024 +0200 @@ -712,6 +712,9 @@ let data_bytes: Option + Send>> = if index.is_inline() { None + } else if index.is_empty() { + // No need to even try to open the data file then. + Some(Box::new(&[][..])) } else { let data_path = data_path.unwrap_or(&default_data_path); let data_mmap = store_vfs.mmap_open(data_path)?;