2022-04-15 03:11:07 +00:00
|
|
|
Patch cargo metadata for Fedora build
|
|
|
|
|
2022-07-11 16:04:12 +00:00
|
|
|
Tweaks that hasn't been upstreamed for 6.2:
|
|
|
|
- update one micro-timer to 0.4.0
|
|
|
|
- update memmap2 to 0.5.3
|
2022-04-15 03:11:07 +00:00
|
|
|
|
|
|
|
Update zstd to 0.10.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
|
2022-07-11 16:04:12 +00:00
|
|
|
@@ -30,10 +30,10 @@ twox-hash = "1.6.2"
|
2022-04-15 03:11:07 +00:00
|
|
|
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.10"
|
|
|
|
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
|
2022-07-11 16:04:12 +00:00
|
|
|
@@ -513,7 +513,7 @@ impl<'a> RevlogEntry<'a> {
|
2022-04-15 03:11:07 +00:00
|
|
|
} 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)
|
2022-07-11 16:04:12 +00:00
|
|
|
.map_err(|e| corrupted(e.to_string()))?;
|
2022-04-15 03:11:07 +00:00
|
|
|
if len != self.uncompressed_len as usize {
|
2022-07-11 16:04:12 +00:00
|
|
|
Err(corrupted("uncompressed length does not match"))
|