mercurial/mercurial-rust-metadata.patch
2022-08-06 22:39:00 +02:00

39 lines
1.5 KiB
Diff

Patch cargo metadata for Fedora build
Tweaks that hasn't been upstreamed for 6.2:
- update one micro-timer to 0.4.0
- update memmap2 to 0.5.3
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
@@ -30,10 +30,10 @@ twox-hash = "1.6.2"
same-file = "1.0.6"
tempfile = "3.1.0"
crossbeam-channel = "0.4"
-micro-timer = "0.3.0"
+micro-timer = "0.4.0"
log = "0.4.8"
-memmap2 = {version = "0.4", features = ["stable_deref_trait"]}
-zstd = "0.5.3"
+memmap2 = {version = "0.5.3", features = ["stable_deref_trait"]}
+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"))