##// END OF EJS Templates
dirstate: invalidate changes when parent-change fails...
dirstate: invalidate changes when parent-change fails When an error occurs during changing parents, we should invalidate all dirstate modifications and reload the dirstate. This is currently done by a `unlock` callback on the `wlock`. To fix this anomaly, we start dealing with the error directly in the context manager and its potential nesting. The "hard" part is to make sure that, when the parent-change context are nested, we and higher level nesting do not continue to use the invalidated dirstate. We introduce dedicated code to enforce that.

File last commit:

r50534:37bc3ede default
r50852:96e526fe default
Show More
debugrequirements.rs
22 lines | 598 B | application/rls-services+xml | RustLexer
/ rust / rhg / src / commands / debugrequirements.rs
Simon Sapin
requirements: move loading to hg-core and add parsing...
r46536 use crate::error::CommandError;
Simon Sapin
rhg: add a `debugrequirements` subcommand...
r46535
pub const HELP_TEXT: &str = "
Print the current repo requirements.
";
Raphaël Gomès
rhg: upgrade `clap` dependency...
r50534 pub fn args() -> clap::Command {
clap::command!("debugrequirements").about(HELP_TEXT)
Simon Sapin
rhg: Move subcommand CLI arguments definitions to respective modules...
r47251 }
Simon Sapin
rhg: Group values passed to every sub-command into a struct...
r47334 pub fn run(invocation: &crate::CliInvocation) -> Result<(), CommandError> {
Simon Sapin
rhg: Move `Repo` object creation into `main()`...
r47335 let repo = invocation.repo?;
Simon Sapin
rhg: replace command structs with functions...
r47250 let mut output = String::new();
let mut requirements: Vec<_> = repo.requirements().iter().collect();
requirements.sort();
for req in requirements {
output.push_str(req);
output.push('\n');
Simon Sapin
rhg: add a `debugrequirements` subcommand...
r46535 }
Simon Sapin
rhg: Group values passed to every sub-command into a struct...
r47334 invocation.ui.write_stdout(output.as_bytes())?;
Simon Sapin
rhg: replace command structs with functions...
r47250 Ok(())
Simon Sapin
rhg: add a `debugrequirements` subcommand...
r46535 }