##// END OF EJS Templates
errors: use InputError in uncommit extension...
errors: use InputError in uncommit extension Differential Revision: https://phab.mercurial-scm.org/D9911

File last commit:

r47190:d03b0601 default
r47192:0e2becd1 default
Show More
debugrequirements.rs
31 lines | 775 B | application/rls-services+xml | RustLexer
/ rust / rhg / src / commands / debugrequirements.rs
Simon Sapin
rhg: add a `debugrequirements` subcommand...
r46535 use crate::commands::Command;
Simon Sapin
requirements: move loading to hg-core and add parsing...
r46536 use crate::error::CommandError;
Simon Sapin
rhg: add a `debugrequirements` subcommand...
r46535 use crate::ui::Ui;
Simon Sapin
rust: introduce Repo and Vfs types for filesystem abstraction...
r46782 use hg::repo::Repo;
Simon Sapin
rhg: add a `debugrequirements` subcommand...
r46535
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> {
Simon Sapin
rust: introduce Repo and Vfs types for filesystem abstraction...
r46782 let repo = Repo::find()?;
Simon Sapin
requirements: move loading to hg-core and add parsing...
r46536 let mut output = String::new();
Simon Sapin
rhg: initial support for shared repositories...
r47190 let mut requirements: Vec<_> = repo.requirements().iter().collect();
requirements.sort();
for req in requirements {
output.push_str(req);
Simon Sapin
requirements: move loading to hg-core and add parsing...
r46536 output.push('\n');
}
ui.write_stdout(output.as_bytes())?;
Simon Sapin
rhg: add a `debugrequirements` subcommand...
r46535 Ok(())
}
}