rust/rhg/src/commands/debugdata.rs
changeset 46484 a6e4e4650bac
parent 46436 252d1bdba33d
child 46500 184e46550dc8
equal deleted inserted replaced
46483:2845892dd489 46484:a6e4e4650bac
     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)?;