equal
deleted
inserted
replaced
1 use crate::commands::Command; |
1 use crate::commands::Command; |
2 use crate::error::CommandError; |
2 use crate::error::CommandError; |
3 use crate::ui::Ui; |
3 use crate::ui::Ui; |
|
4 use hg::config::Config; |
4 use hg::operations::{debug_data, DebugDataKind}; |
5 use hg::operations::{debug_data, DebugDataKind}; |
5 use hg::repo::Repo; |
6 use hg::repo::Repo; |
6 use micro_timer::timed; |
7 use micro_timer::timed; |
7 |
8 |
8 pub const HELP_TEXT: &str = " |
9 pub const HELP_TEXT: &str = " |
20 } |
21 } |
21 } |
22 } |
22 |
23 |
23 impl<'a> Command for DebugDataCommand<'a> { |
24 impl<'a> Command for DebugDataCommand<'a> { |
24 #[timed] |
25 #[timed] |
25 fn run(&self, ui: &Ui) -> Result<(), CommandError> { |
26 fn run(&self, ui: &Ui, config: &Config) -> Result<(), CommandError> { |
26 let repo = Repo::find()?; |
27 let repo = Repo::find(config)?; |
27 let data = debug_data(&repo, self.rev, self.kind) |
28 let data = debug_data(&repo, self.rev, self.kind) |
28 .map_err(|e| (e, self.rev))?; |
29 .map_err(|e| (e, self.rev))?; |
29 |
30 |
30 let mut stdout = ui.stdout_buffer(); |
31 let mut stdout = ui.stdout_buffer(); |
31 stdout.write_all(&data)?; |
32 stdout.write_all(&data)?; |