Mercurial > public > mercurial-scm > hg
comparison rust/hg-core/src/lib.rs @ 42753:fce6dc93a510
rust-dirstate: rust implementation of dirstatemap
The `dirstatemap` is one of the last building blocks needed to get to a
`dirstate.walk` Rust implementation.
Disclaimer: This change is part of a big (10) series of patches, all of which
started as one big changeset that took a long time to write.
This `dirstatemap` implementation is a compromise in terms of complexity both
for me and for the reviewers. I chose to submit this patch right now because
while it is not perfect, it works and is simple enough (IMHO) to be reviewed.
The Python implementation uses a lot of lazy propertycaches, breaks
encapsulation and is used as an iterator in a lot of places, all of which
dictated the somewhat unidiomatic patterns in this change.
Like written in the comments, rewriting this struct to use the typestate
pattern might be a good idea, but this is a good first step.
Differential Revision: https://phab.mercurial-scm.org/D6632
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Wed, 10 Jul 2019 09:56:23 +0200 |
parents | 7ceded4419a3 |
children | 2e1f74cc3350 |
comparison
equal
deleted
inserted
replaced
42752:30320c7bf79f | 42753:fce6dc93a510 |
---|---|
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 dirstate_map::DirstateMap, | |
13 parsers::{pack_dirstate, parse_dirstate, PARENT_SIZE}, | 14 parsers::{pack_dirstate, parse_dirstate, PARENT_SIZE}, |
14 CopyMap, DirsIterable, DirstateEntry, DirstateParents, EntryState, | 15 CopyMap, DirsIterable, DirstateEntry, DirstateParents, EntryState, |
15 StateMap, | 16 StateMap, |
16 }; | 17 }; |
17 mod filepatterns; | 18 mod filepatterns; |