Mercurial > hg
diff rust/hg-core/src/lib.rs @ 42303:e240bec26626
rust-dirstate: add rust-cpython bindings to the new parse/pack functions
This allows for Python code to call `parse/pack_dirstate` transparently.
These bindings are heavy given the relatively simple task, as they are bound
to implementation details of both the C and Python code. They will be slimmed
down in future patches and eventually completely removed once more of the
dirstate code has been refactored/rewritten in Rust.
Both functions emulate the mutate-on-loop style of the Python and C
implementations by looping over changed items in the compatibility layer,
instead of at the core functions.
Differential Revision: https://phab.mercurial-scm.org/D6349
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Mon, 06 May 2019 22:50:34 +0200 |
parents | d1786c1d34fa |
children | e8f3740cc067 |
line wrap: on
line diff
--- a/rust/hg-core/src/lib.rs Mon May 06 22:48:09 2019 +0200 +++ b/rust/hg-core/src/lib.rs Mon May 06 22:50:34 2019 +0200 @@ -8,8 +8,13 @@ mod ancestors; pub mod dagops; pub use ancestors::{AncestorsIterator, LazyAncestors, MissingAncestors}; -pub mod testing; // unconditionally built, for use from integration tests +mod dirstate; pub mod discovery; +pub mod testing; // unconditionally built, for use from integration tests +pub use dirstate::{ + pack_dirstate, parse_dirstate, CopyVec, CopyVecEntry, DirstateEntry, + DirstateParents, DirstateVec, +}; /// Mercurial revision numbers /// @@ -17,7 +22,6 @@ /// 4 bytes, and are liberally converted to ints, whence the i32 pub type Revision = i32; - /// Marker expressing the absence of a parent /// /// Independently of the actual representation, `NULL_REVISION` is guaranteed