--- a/rust/hg-core/src/dirstate_tree/dirstate_map.rs Sat Jun 11 00:26:25 2022 +0200
+++ b/rust/hg-core/src/dirstate_tree/dirstate_map.rs Thu Jun 16 15:20:48 2022 +0200
@@ -31,6 +31,13 @@
/// anymore) is less than this fraction of the total amount of existing data.
const ACCEPTABLE_UNREACHABLE_BYTES_RATIO: f32 = 0.5;
+#[derive(Debug, PartialEq, Eq)]
+/// Version of the on-disk format
+pub enum DirstateVersion {
+ V1,
+ V2,
+}
+
#[derive(Debug)]
pub struct DirstateMap<'on_disk> {
/// Contents of the `.hg/dirstate` file
@@ -54,6 +61,8 @@
/// Size of the data used to first load this `DirstateMap`. Used in case
/// we need to write some new metadata, but no new data on disk.
pub(super) old_data_size: usize,
+
+ pub(super) dirstate_version: DirstateVersion,
}
/// Using a plain `HgPathBuf` of the full path from the repository root as a
@@ -441,6 +450,7 @@
ignore_patterns_hash: [0; on_disk::IGNORE_PATTERNS_HASH_LEN],
unreachable_bytes: 0,
old_data_size: 0,
+ dirstate_version: DirstateVersion::V1,
}
}