comparison rust/hg-core/src/lib.rs @ 42748:7cae6bc29ff9

rust-parsers: switch to parse/pack_dirstate to mutate-on-loop Both `parse_dirstate` and `pack_dirstate` can operate directly on the data they're passed, which prevents the creation of intermediate data structures, simplifies the function signatures and reduces boilerplate. They are exposed directly to the Python for now, but a later patch will make use of them inside `hg-core`. Differential Revision: https://phab.mercurial-scm.org/D6628
author Raphaël Gomès <rgomes@octobus.net>
date Tue, 09 Jul 2019 11:49:49 +0200
parents 5672bb73f61e
children 7ceded4419a3
comparison
equal deleted inserted replaced
42747:760a7851e9ba 42748:7cae6bc29ff9
8 mod dirstate; 8 mod dirstate;
9 pub mod discovery; 9 pub mod discovery;
10 pub mod testing; // unconditionally built, for use from integration tests 10 pub mod testing; // unconditionally built, for use from integration tests
11 pub use dirstate::{ 11 pub use dirstate::{
12 dirs_multiset::DirsMultiset, 12 dirs_multiset::DirsMultiset,
13 parsers::{pack_dirstate, parse_dirstate}, 13 parsers::{pack_dirstate, parse_dirstate, PARENT_SIZE},
14 CopyVec, CopyVecEntry, DirsIterable, DirstateEntry, DirstateParents, 14 CopyMap, DirsIterable, DirstateEntry, DirstateParents, StateMap,
15 DirstateVec,
16 }; 15 };
17 mod filepatterns; 16 mod filepatterns;
18 pub mod utils; 17 pub mod utils;
19 18
20 pub use filepatterns::{ 19 pub use filepatterns::{
58 #[derive(Clone, Debug, PartialEq)] 57 #[derive(Clone, Debug, PartialEq)]
59 pub enum DirstateParseError { 58 pub enum DirstateParseError {
60 TooLittleData, 59 TooLittleData,
61 Overflow, 60 Overflow,
62 CorruptedEntry(String), 61 CorruptedEntry(String),
62 Damaged,
63 } 63 }
64 64
65 #[derive(Debug, PartialEq)] 65 #[derive(Debug, PartialEq)]
66 pub enum DirstatePackError { 66 pub enum DirstatePackError {
67 CorruptedEntry(String), 67 CorruptedEntry(String),