1 // Copyright 2019 Raphaël Gomès <rgomes@octobus.net> |
1 // Copyright 2019 Raphaël Gomès <rgomes@octobus.net> |
2 // |
2 // |
3 // This software may be used and distributed according to the terms of the |
3 // This software may be used and distributed according to the terms of the |
4 // GNU General Public License version 2 or any later version. |
4 // GNU General Public License version 2 or any later version. |
5 |
5 |
|
6 use crate::{ |
|
7 CopyVec, CopyVecEntry, DirstateEntry, DirstatePackError, DirstateParents, |
|
8 DirstateParseError, DirstateVec, |
|
9 }; |
6 use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt}; |
10 use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt}; |
7 use std::collections::HashMap; |
11 use std::collections::HashMap; |
8 use std::io::Cursor; |
12 use std::io::Cursor; |
9 use { |
|
10 CopyVec, CopyVecEntry, DirstateEntry, DirstatePackError, DirstateParents, |
|
11 DirstateParseError, DirstateVec, |
|
12 }; |
|
13 |
13 |
14 /// Parents are stored in the dirstate as byte hashes. |
14 /// Parents are stored in the dirstate as byte hashes. |
15 const PARENT_SIZE: usize = 20; |
15 const PARENT_SIZE: usize = 20; |
16 /// Dirstate entries have a static part of 8 + 32 + 32 + 32 + 32 bits. |
16 /// Dirstate entries have a static part of 8 + 32 + 32 + 32 + 32 bits. |
17 const MIN_ENTRY_SIZE: usize = 17; |
17 const MIN_ENTRY_SIZE: usize = 17; |