mercurial/mercurial-rust-metadata.patch
2022-09-04 12:00:43 +02:00

30 lines
1.2 KiB
Diff

Patch cargo metadata for Fedora build
Update zstd to 0.11.0 (upstream is stuck on 0.5 because MSRV)
- adapt for breaking changes in zstd 0.10.0
diff --git a/rust/hg-core/Cargo.toml b/rust/hg-core/Cargo.toml
--- a/rust/hg-core/Cargo.toml
+++ b/rust/hg-core/Cargo.toml
@@ -33,7 +33,7 @@
micro-timer = "0.4.0"
log = "0.4.8"
memmap2 = { version = "0.5.3", features = ["stable_deref_trait"] }
-zstd = "0.5.3"
+zstd = "0.11"
format-bytes = "0.3.0"
# We don't use the `miniz-oxide` backend to not change rhg benchmarks and until
diff --git a/rust/hg-core/src/revlog/revlog.rs b/rust/hg-core/src/revlog/revlog.rs
--- a/rust/hg-core/src/revlog/revlog.rs
+++ b/rust/hg-core/src/revlog/revlog.rs
@@ -513,7 +513,7 @@ impl<'a> RevlogEntry<'a> {
} else {
let cap = self.uncompressed_len.max(0) as usize;
let mut buf = vec![0; cap];
- let len = zstd::block::decompress_to_buffer(self.bytes, &mut buf)
+ let len = zstd::bulk::decompress_to_buffer(self.bytes, &mut buf)
.map_err(|e| corrupted(e.to_string()))?;
if len != self.uncompressed_len as usize {
Err(corrupted("uncompressed length does not match"))