Patchwork [05,of,11] rust-dirstate: rename NULL_REVISION to NULL_ID which isn't a revision number

login
register
mail settings
Submitter Yuya Nishihara
Date Aug. 17, 2019, 12:12 p.m.
Message ID <f61ecf74968aae152d1c.1566043926@mimosa>
Download mbox | patch
Permalink /patch/41327/
State Accepted
Headers show

Comments

Yuya Nishihara - Aug. 17, 2019, 12:12 p.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1566016031 -32400
#      Sat Aug 17 13:27:11 2019 +0900
# Node ID f61ecf74968aae152d1cdbe946d3f418b0fa1381
# Parent  af8265f67d45cfff198c26e639b57e98c0c56287
rust-dirstate: rename NULL_REVISION to NULL_ID which isn't a revision number

Patch

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
@@ -20,7 +20,7 @@  use std::time::Duration;
 
 pub type FileFoldMap = HashMap<Vec<u8>, Vec<u8>>;
 
-const NULL_REVISION: [u8; 20] = [0; 20];
+const NULL_ID: [u8; 20] = [0; 20];
 const MTIME_UNSET: i32 = -1;
 const SIZE_DIRTY: i32 = -2;
 
@@ -69,8 +69,8 @@  impl DirstateMap {
         self.non_normal_set.clear();
         self.other_parent_set.clear();
         self.set_parents(DirstateParents {
-            p1: NULL_REVISION,
-            p2: NULL_REVISION,
+            p1: NULL_ID,
+            p2: NULL_ID,
         })
     }
 
@@ -267,8 +267,8 @@  impl DirstateMap {
             };
         } else if file_contents.is_empty() {
             parents = DirstateParents {
-                p1: NULL_REVISION,
-                p2: NULL_REVISION,
+                p1: NULL_ID,
+                p2: NULL_ID,
             };
         } else {
             return Err(DirstateError::Parse(DirstateParseError::Damaged));