##// END OF EJS Templates
log: introduce struct that carries log traversal options...
log: introduce struct that carries log traversal options I tried to refactor logcmdutil.getrevs() without using an options struct, but none of these attempts didn't work out. Since every stage of getrevs() needs various log command options (e.g. both matcher and revset query need file patterns), it isn't possible to cleanly split getrevs() into a command layer and a core logic. So, this patch introduces a named struct to carry command options in slightly abstracted way, which will be later used by "hg grep" and "hg churn". More fields will be added to the walkopt struct. Type hints aren't verified. I couldn't figure out how to teach pytype to load its own attr type stubs in place of our .thirdparty.attr. Conditional import didn't work. s/^from \.thirdparty // is the only way I found pytype could parse the @attr.ib decorator.

File last commit:

r46112:522ec3dc default
r46139:c1d0f83d default
Show More
mod.rs
28 lines | 1.0 KiB | application/rls-services+xml | RustLexer
//! 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.