##// END OF EJS Templates
engine: prevent a function call for each store file...
engine: prevent a function call for each store file Python function calls are not cheap. Instead of calling the function once for each file in store, we use a dedicated function which filters and yields the required files. Differential Revision: https://phab.mercurial-scm.org/D9673

File last commit:

r46782:8a491439 default
r46846:52abb1af default
Show More
debugrequirements.rs
30 lines | 706 B | application/rls-services+xml | RustLexer
/ rust / rhg / src / commands / debugrequirements.rs
use crate::commands::Command;
use crate::error::CommandError;
use crate::ui::Ui;
use hg::repo::Repo;
use hg::requirements;
pub const HELP_TEXT: &str = "
Print the current repo requirements.
";
pub struct DebugRequirementsCommand {}
impl DebugRequirementsCommand {
pub fn new() -> Self {
DebugRequirementsCommand {}
}
}
impl Command for DebugRequirementsCommand {
fn run(&self, ui: &Ui) -> Result<(), CommandError> {
let repo = Repo::find()?;
let mut output = String::new();
for req in requirements::load(&repo)? {
output.push_str(&req);
output.push('\n');
}
ui.write_stdout(output.as_bytes())?;
Ok(())
}
}