##// END OF EJS Templates
rust: introduce Repo and Vfs types for filesystem abstraction...
rust: introduce Repo and Vfs types for filesystem abstraction This is similar to the corresponding Python classes. Repo represents a repository and knows the path to the `.hg` directory, the `store` directory, and the working directory. Separating these will enable supporting the share extension. A Vfs is created from a Repo for one of these three directories. It has filesystem access APIs that take a relative std::path::Path as a parameter. Differential Revision: https://phab.mercurial-scm.org/D9596

File last commit:

r46782:8a491439 default
r46782:8a491439 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(())
}
}