diff rust/hg-core/src/revlog/node.rs @ 45531:b0d6309ff50c

hg-core: check data integrity in `Revlog` Check that the hash of the data reconstructed from deltas matches the hash stored in the revision. Differential Revision: https://phab.mercurial-scm.org/D9005
author Antoine Cezar <antoine.cezar@octobus.net>
date Wed, 02 Sep 2020 15:23:25 +0200
parents 26114bd6ec60
children 88e741bf2d93
line wrap: on
line diff
--- a/rust/hg-core/src/revlog/node.rs	Wed Sep 23 12:26:16 2020 +0200
+++ b/rust/hg-core/src/revlog/node.rs	Wed Sep 02 15:23:25 2020 +0200
@@ -16,7 +16,12 @@
 /// are private so that calling code does not expect all nodes have
 /// the same size, should we support several formats concurrently in
 /// the future.
-const NODE_BYTES_LENGTH: usize = 20;
+pub const NODE_BYTES_LENGTH: usize = 20;
+
+/// Id of the null node.
+///
+/// Used to indicate the absence of node.
+pub const NULL_NODE_ID: [u8; NODE_BYTES_LENGTH] = [0u8; NODE_BYTES_LENGTH];
 
 /// The length in bytes of a `Node`
 ///