diff rust/rhg/src/commands/debugdata.rs @ 46555:d8730ff51d5a

rhg: Add support for -R and --repository command-line arguments Differential Revision: https://phab.mercurial-scm.org/D9970
author Simon Sapin <simon.sapin@octobus.net>
date Mon, 08 Feb 2021 21:37:30 +0100
parents 1ecaf09d9964
children 80840b651721
line wrap: on
line diff
--- a/rust/rhg/src/commands/debugdata.rs	Mon Feb 08 21:28:52 2021 +0100
+++ b/rust/rhg/src/commands/debugdata.rs	Mon Feb 08 21:37:30 2021 +0100
@@ -7,6 +7,7 @@
 use hg::operations::{debug_data, DebugDataKind};
 use hg::repo::Repo;
 use micro_timer::timed;
+use std::path::Path;
 
 pub const HELP_TEXT: &str = "
 Dump the contents of a data file revision
@@ -44,6 +45,7 @@
 pub fn run(
     ui: &Ui,
     config: &Config,
+    repo_path: Option<&Path>,
     args: &ArgMatches,
 ) -> Result<(), CommandError> {
     let rev = args
@@ -61,7 +63,7 @@
             }
         };
 
-    let repo = Repo::find(config)?;
+    let repo = Repo::find(config, repo_path)?;
     let data = debug_data(&repo, rev, kind).map_err(|e| (e, rev))?;
 
     let mut stdout = ui.stdout_buffer();