Show More
@@ -0,0 +1,28 b'' | |||||
|
1 | pub mod parsers; | |||
|
2 | ||||
|
3 | #[derive(Debug, PartialEq, Copy, Clone)] | |||
|
4 | pub struct DirstateParents<'a> { | |||
|
5 | pub p1: &'a [u8], | |||
|
6 | pub p2: &'a [u8], | |||
|
7 | } | |||
|
8 | ||||
|
9 | /// The C implementation uses all signed types. This will be an issue | |||
|
10 | /// either when 4GB+ source files are commonplace or in 2038, whichever | |||
|
11 | /// comes first. | |||
|
12 | #[derive(Debug, PartialEq)] | |||
|
13 | pub struct DirstateEntry { | |||
|
14 | pub state: i8, | |||
|
15 | pub mode: i32, | |||
|
16 | pub mtime: i32, | |||
|
17 | pub size: i32, | |||
|
18 | } | |||
|
19 | ||||
|
20 | pub type DirstateVec = Vec<(Vec<u8>, DirstateEntry)>; | |||
|
21 | ||||
|
22 | #[derive(Debug, PartialEq)] | |||
|
23 | pub struct CopyVecEntry<'a> { | |||
|
24 | pub path: &'a [u8], | |||
|
25 | pub copy_path: &'a [u8], | |||
|
26 | } | |||
|
27 | ||||
|
28 | pub type CopyVec<'a> = Vec<CopyVecEntry<'a>>; |
@@ -6,31 +6,10 b'' | |||||
6 | use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt}; |
|
6 | use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt}; | |
7 | use std::collections::HashMap; |
|
7 | use std::collections::HashMap; | |
8 | use std::io::Cursor; |
|
8 | use std::io::Cursor; | |
9 | use {DirstatePackError, DirstateParseError}; |
|
9 | use { | |
10 |
|
10 | CopyVec, CopyVecEntry, DirstateEntry, DirstatePackError, DirstateParents, | ||
11 | #[derive(Debug, PartialEq, Copy, Clone)] |
|
11 | DirstateParseError, DirstateVec, | |
12 | pub struct DirstateParents<'a> { |
|
12 | }; | |
13 | pub p1: &'a [u8], |
|
|||
14 | pub p2: &'a [u8], |
|
|||
15 | } |
|
|||
16 | /// The C implementation uses all signed types. This will be an issue |
|
|||
17 | /// either when 4GB+ source files are commonplace or in 2038, whichever |
|
|||
18 | /// comes first. |
|
|||
19 | #[derive(Debug, PartialEq)] |
|
|||
20 | pub struct DirstateEntry { |
|
|||
21 | pub state: i8, |
|
|||
22 | pub mode: i32, |
|
|||
23 | pub mtime: i32, |
|
|||
24 | pub size: i32, |
|
|||
25 | } |
|
|||
26 | pub type DirstateVec = Vec<(Vec<u8>, DirstateEntry)>; |
|
|||
27 |
|
||||
28 | #[derive(Debug, PartialEq)] |
|
|||
29 | pub struct CopyVecEntry<'a> { |
|
|||
30 | pub path: &'a [u8], |
|
|||
31 | pub copy_path: &'a [u8], |
|
|||
32 | } |
|
|||
33 | pub type CopyVec<'a> = Vec<CopyVecEntry<'a>>; |
|
|||
34 |
|
13 | |||
35 | /// Parents are stored in the dirstate as byte hashes. |
|
14 | /// Parents are stored in the dirstate as byte hashes. | |
36 | const PARENT_SIZE: usize = 20; |
|
15 | const PARENT_SIZE: usize = 20; |
@@ -15,8 +15,8 b' mod dirstate;' | |||||
15 | pub mod discovery; |
|
15 | pub mod discovery; | |
16 | pub mod testing; // unconditionally built, for use from integration tests |
|
16 | pub mod testing; // unconditionally built, for use from integration tests | |
17 | pub use dirstate::{ |
|
17 | pub use dirstate::{ | |
18 | pack_dirstate, parse_dirstate, CopyVec, CopyVecEntry, DirstateEntry, |
|
18 | parsers::{pack_dirstate, parse_dirstate}, | |
19 | DirstateParents, DirstateVec, |
|
19 | CopyVec, CopyVecEntry, DirstateEntry, DirstateParents, DirstateVec, | |
20 | }; |
|
20 | }; | |
21 | mod filepatterns; |
|
21 | mod filepatterns; | |
22 |
|
22 |
General Comments 0
You need to be logged in to leave comments.
Login now