Mercurial > hg
view rust/hg-core/src/operations/mod.rs @ 45610:496537c9c1b4
rust: start plugging the dirstate tree behind a feature gate
The previous patch added the `dirstate-tree` feature gate to enable the two
dirstate implementations to co-habit while the tree-based one gets better.
This patch copies over the code that differs, be it because the algorithm
changed or because the borrowing rules are different.
Indeed, `DirstateTree` is not observationally equivalent to the std `HashMap` in
the APIs we use: it does not have the `Entry` API (yet?) and its iterator
returns owned values instead of references. This last point is because the
implementation needs to be changed to a more clever and efficient solution.
Differential Revision: https://phab.mercurial-scm.org/D9133
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Wed, 30 Sep 2020 18:10:29 +0200 |
parents | 522ec3dc44b9 |
children | dca9cb99971c |
line wrap: on
line source
//! A distinction is made between operations and commands. //! An operation is what can be done whereas a command is what is exposed by //! the cli. A single command can use several operations to achieve its goal. mod cat; mod debugdata; mod dirstate_status; mod find_root; mod list_tracked_files; pub use cat::{CatRev, CatRevError, CatRevErrorKind}; pub use debugdata::{ DebugData, DebugDataError, DebugDataErrorKind, DebugDataKind, }; pub use find_root::{FindRoot, FindRootError, FindRootErrorKind}; pub use list_tracked_files::{ ListDirstateTrackedFiles, ListDirstateTrackedFilesError, ListDirstateTrackedFilesErrorKind, }; pub use list_tracked_files::{ ListRevTrackedFiles, ListRevTrackedFilesError, ListRevTrackedFilesErrorKind, }; // TODO add an `Operation` trait when GAT have landed (rust #44265): // there is no way to currently define a trait which can both return // references to `self` and to passed data, which is what we would need. // Generic Associated Types may fix this and allow us to have a unified // interface.