comparison rust/rhg/src/commands/debugdata.rs @ 45530:b1cea0dc9db0

rhg: Add debug timing Differential Revision: https://phab.mercurial-scm.org/D8962
author Antoine Cezar <antoine.cezar@octobus.net>
date Wed, 23 Sep 2020 12:26:16 +0200
parents 66756b34c06e
children 8d6164098782
comparison
equal deleted inserted replaced
45529:f17caf8f3fef 45530:b1cea0dc9db0
3 use crate::ui::utf8_to_local; 3 use crate::ui::utf8_to_local;
4 use crate::ui::Ui; 4 use crate::ui::Ui;
5 use hg::operations::{ 5 use hg::operations::{
6 DebugData, DebugDataError, DebugDataErrorKind, DebugDataKind, 6 DebugData, DebugDataError, DebugDataErrorKind, DebugDataKind,
7 }; 7 };
8 use micro_timer::timed;
8 9
9 pub const HELP_TEXT: &str = " 10 pub const HELP_TEXT: &str = "
10 Dump the contents of a data file revision 11 Dump the contents of a data file revision
11 "; 12 ";
12 13
20 DebugDataCommand { rev, kind } 21 DebugDataCommand { rev, kind }
21 } 22 }
22 } 23 }
23 24
24 impl<'a> Command for DebugDataCommand<'a> { 25 impl<'a> Command for DebugDataCommand<'a> {
26 #[timed]
25 fn run(&self, ui: &Ui) -> Result<(), CommandError> { 27 fn run(&self, ui: &Ui) -> Result<(), CommandError> {
26 let mut operation = DebugData::new(self.rev, self.kind); 28 let mut operation = DebugData::new(self.rev, self.kind);
27 let data = 29 let data =
28 operation.run().map_err(|e| to_command_error(self.rev, e))?; 30 operation.run().map_err(|e| to_command_error(self.rev, e))?;
29 31