rust/rhg/src/commands/debugdata.rs
changeset 46593 5ce2aa7c2ad5
parent 46592 80840b651721
child 49480 0199712c7a6d
equal deleted inserted replaced
46592:80840b651721 46593:5ce2aa7c2ad5
     1 use crate::error::CommandError;
     1 use crate::error::CommandError;
     2 use clap::Arg;
     2 use clap::Arg;
     3 use clap::ArgGroup;
     3 use clap::ArgGroup;
     4 use hg::operations::{debug_data, DebugDataKind};
     4 use hg::operations::{debug_data, DebugDataKind};
     5 use hg::repo::Repo;
       
     6 use micro_timer::timed;
     5 use micro_timer::timed;
     7 
     6 
     8 pub const HELP_TEXT: &str = "
     7 pub const HELP_TEXT: &str = "
     9 Dump the contents of a data file revision
     8 Dump the contents of a data file revision
    10 ";
     9 ";
    53             (false, false) => {
    52             (false, false) => {
    54                 unreachable!("Should not happen since options are required")
    53                 unreachable!("Should not happen since options are required")
    55             }
    54             }
    56         };
    55         };
    57 
    56 
    58     let repo = Repo::find(invocation.non_repo_config, invocation.repo_path)?;
    57     let repo = invocation.repo?;
    59     let data = debug_data(&repo, rev, kind).map_err(|e| (e, rev))?;
    58     let data = debug_data(repo, rev, kind).map_err(|e| (e, rev))?;
    60 
    59 
    61     let mut stdout = invocation.ui.stdout_buffer();
    60     let mut stdout = invocation.ui.stdout_buffer();
    62     stdout.write_all(&data)?;
    61     stdout.write_all(&data)?;
    63     stdout.flush()?;
    62     stdout.flush()?;
    64 
    63