[Updated] D8962: rhg: Add debug timing
acezar (Antoine Cezar)
phabricator at mercurial-scm.org
Wed Sep 23 14:57:20 UTC 2020
Closed by commit rHGb1cea0dc9db0: rhg: Add debug timing (authored by acezar).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D8962?vs=22776&id=22789
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D8962/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D8962
AFFECTED FILES
rust/Cargo.lock
rust/rhg/Cargo.toml
rust/rhg/src/commands/debugdata.rs
rust/rhg/src/main.rs
CHANGE DETAILS
diff --git a/rust/rhg/src/main.rs b/rust/rhg/src/main.rs
--- a/rust/rhg/src/main.rs
+++ b/rust/rhg/src/main.rs
@@ -1,3 +1,4 @@
+extern crate log;
use clap::App;
use clap::AppSettings;
use clap::Arg;
@@ -15,6 +16,7 @@
use error::CommandError;
fn main() {
+ env_logger::init();
let app = App::new("rhg")
.setting(AppSettings::AllowInvalidUtf8)
.setting(AppSettings::SubcommandRequired)
diff --git a/rust/rhg/src/commands/debugdata.rs b/rust/rhg/src/commands/debugdata.rs
--- a/rust/rhg/src/commands/debugdata.rs
+++ b/rust/rhg/src/commands/debugdata.rs
@@ -5,6 +5,7 @@
use hg::operations::{
DebugData, DebugDataError, DebugDataErrorKind, DebugDataKind,
};
+use micro_timer::timed;
pub const HELP_TEXT: &str = "
Dump the contents of a data file revision
@@ -22,6 +23,7 @@
}
impl<'a> Command for DebugDataCommand<'a> {
+ #[timed]
fn run(&self, ui: &Ui) -> Result<(), CommandError> {
let mut operation = DebugData::new(self.rev, self.kind);
let data =
diff --git a/rust/rhg/Cargo.toml b/rust/rhg/Cargo.toml
--- a/rust/rhg/Cargo.toml
+++ b/rust/rhg/Cargo.toml
@@ -7,4 +7,6 @@
[dependencies]
hg-core = { path = "../hg-core"}
clap = "2.33.1"
-
+log = "0.4.11"
+micro-timer = "0.3.1"
+env_logger = "0.7.1"
diff --git a/rust/Cargo.lock b/rust/Cargo.lock
--- a/rust/Cargo.lock
+++ b/rust/Cargo.lock
@@ -569,7 +569,10 @@
version = "0.1.0"
dependencies = [
"clap 2.33.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "env_logger 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"hg-core 0.1.0",
+ "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)",
+ "micro-timer 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
To: acezar, #hg-reviewers, marmoute, Alphare
Cc: martinvonz, marmoute, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20200923/78c55600/attachment-0002.html>
More information about the Mercurial-patches
mailing list