diff --git a/mercurial/dirstateutils/docket.py b/mercurial/dirstateutils/docket.py --- a/mercurial/dirstateutils/docket.py +++ b/mercurial/dirstateutils/docket.py @@ -16,7 +16,7 @@ # Must match the constant of the same name in # `rust/hg-core/src/dirstate_tree/on_disk.rs` -TREE_METADATA_SIZE = 40 +TREE_METADATA_SIZE = 44 # * 12 bytes: format marker # * 32 bytes: node ID of the working directory's first parent diff --git a/rust/hg-core/src/dirstate_tree/on_disk.rs b/rust/hg-core/src/dirstate_tree/on_disk.rs --- a/rust/hg-core/src/dirstate_tree/on_disk.rs +++ b/rust/hg-core/src/dirstate_tree/on_disk.rs @@ -49,13 +49,13 @@ /// Must match the constant of the same name in /// `mercurial/dirstateutils/docket.py` -const TREE_METADATA_SIZE: usize = 40; +const TREE_METADATA_SIZE: usize = 44; /// Make sure that size-affecting changes are made knowingly #[allow(unused)] fn static_assert_size_of() { - let _ = std::mem::transmute::; let _ = std::mem::transmute::; + let _ = std::mem::transmute::; let _ = std::mem::transmute::; } @@ -90,6 +90,12 @@ /// How many bytes of this data file are not used anymore unreachable_bytes: Size, + /// Current version always sets these bytes to zero when creating or + /// updating a dirstate. Future versions could assign some bits to signal + /// for example "the version that last wrote/updated this dirstate did so + /// in such and such way that can be relied on by versions that know to." + unused: [u8; 4], + /// If non-zero, a hash of ignore files that were used for some previous /// run of the `status` algorithm. /// @@ -579,6 +585,7 @@ .nodes_with_copy_source_count .into(), unreachable_bytes: dirstate_map.unreachable_bytes.into(), + unused: [0; 4], ignore_patterns_hash: dirstate_map.ignore_patterns_hash, }; Ok((writer.out, meta.as_bytes().to_vec(), append))