##// END OF EJS Templates
engine: 'if not, else' -> 'if, else'...
engine: 'if not, else' -> 'if, else' I personally feel that ``` if x: pass else: pass ``` is easier to read and edit than ``` if not x: pass else: pass ``` Next patches will add one more if-else clause. Differential Revision: https://phab.mercurial-scm.org/D9931

File last commit:

r47165:252d1bdb default
r47194:45c3a263 default
Show More
debugdata.rs
36 lines | 848 B | application/rls-services+xml | RustLexer
use crate::commands::Command;
use crate::error::CommandError;
use crate::ui::Ui;
use hg::operations::{debug_data, DebugDataKind};
use hg::repo::Repo;
use micro_timer::timed;
pub const HELP_TEXT: &str = "
Dump the contents of a data file revision
";
pub struct DebugDataCommand<'a> {
rev: &'a str,
kind: DebugDataKind,
}
impl<'a> DebugDataCommand<'a> {
pub fn new(rev: &'a str, kind: DebugDataKind) -> Self {
DebugDataCommand { rev, kind }
}
}
impl<'a> Command for DebugDataCommand<'a> {
#[timed]
fn run(&self, ui: &Ui) -> Result<(), CommandError> {
let repo = Repo::find()?;
let data = debug_data(&repo, self.rev, self.kind)
.map_err(|e| (e, self.rev))?;
let mut stdout = ui.stdout_buffer();
stdout.write_all(&data)?;
stdout.flush()?;
Ok(())
}
}