[PATCH 06 of 11] rust-dirstate: use PARENT_SIZE constant where appropriate

Yuya Nishihara yuya at tcha.org
Sat Aug 17 08:12:07 EDT 2019


# HG changeset patch
# User Yuya Nishihara <yuya at tcha.org>
# Date 1566017705 -32400
#      Sat Aug 17 13:55:05 2019 +0900
# Node ID a57c56ff9cec59f12780c83f5dc2ab679d2523e6
# Parent  f61ecf74968aae152d1cdbe946d3f418b0fa1381
rust-dirstate: use PARENT_SIZE constant where appropriate

diff --git a/rust/hg-core/src/dirstate/dirstate_map.rs b/rust/hg-core/src/dirstate/dirstate_map.rs
--- a/rust/hg-core/src/dirstate/dirstate_map.rs
+++ b/rust/hg-core/src/dirstate/dirstate_map.rs
@@ -258,7 +258,7 @@ impl DirstateMap {
             return Ok(parents.clone());
         }
         let parents;
-        if file_contents.len() == 40 {
+        if file_contents.len() == PARENT_SIZE * 2 {
             parents = DirstateParents {
                 p1: copy_into_array(&file_contents[..PARENT_SIZE]),
                 p2: copy_into_array(


More information about the Mercurial-devel mailing list