##// END OF EJS Templates
rhg: use `format_bytes!` for error messages...
rhg: use `format_bytes!` for error messages This change also includes a formatting changing with the new `rustfmt` version, but I'm expecting it to have already been applied in another patch by the time this lands. Differential Revision: https://phab.mercurial-scm.org/D9407

File last commit:

r46536:a2eda1ff default
r46598:fada3387 default
Show More
debugrequirements.rs
30 lines | 725 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::operations::FindRoot;
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 root = FindRoot::new().run()?;
let mut output = String::new();
for req in requirements::load(&root)? {
output.push_str(&req);
output.push('\n');
}
ui.write_stdout(output.as_bytes())?;
Ok(())
}
}