Show More
@@ -536,8 +536,8 b' dependencies = [' | |||||
536 | "lazy_static", |
|
536 | "lazy_static", | |
537 | "libc", |
|
537 | "libc", | |
538 | "log", |
|
538 | "log", | |
|
539 | "logging_timer", | |||
539 | "memmap2", |
|
540 | "memmap2", | |
540 | "micro-timer", |
|
|||
541 | "once_cell", |
|
541 | "once_cell", | |
542 | "ouroboros", |
|
542 | "ouroboros", | |
543 | "pretty_assertions", |
|
543 | "pretty_assertions", | |
@@ -705,6 +705,28 b' dependencies = [' | |||||
705 | ] |
|
705 | ] | |
706 |
|
706 | |||
707 | [[package]] |
|
707 | [[package]] | |
|
708 | name = "logging_timer" | |||
|
709 | version = "1.1.0" | |||
|
710 | source = "registry+https://github.com/rust-lang/crates.io-index" | |||
|
711 | checksum = "64e96f261d684b7089aa576bb74e823241dccd994b27d30fabf1dcb3af284fe9" | |||
|
712 | dependencies = [ | |||
|
713 | "log", | |||
|
714 | "logging_timer_proc_macros", | |||
|
715 | ] | |||
|
716 | ||||
|
717 | [[package]] | |||
|
718 | name = "logging_timer_proc_macros" | |||
|
719 | version = "1.1.0" | |||
|
720 | source = "registry+https://github.com/rust-lang/crates.io-index" | |||
|
721 | checksum = "10a9062912d7952c5588cc474795e0b9ee008e7e6781127945b85413d4b99d81" | |||
|
722 | dependencies = [ | |||
|
723 | "log", | |||
|
724 | "proc-macro2", | |||
|
725 | "quote", | |||
|
726 | "syn", | |||
|
727 | ] | |||
|
728 | ||||
|
729 | [[package]] | |||
708 | name = "memchr" |
|
730 | name = "memchr" | |
709 | version = "2.5.0" |
|
731 | version = "2.5.0" | |
710 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
732 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
@@ -730,28 +752,6 b' dependencies = [' | |||||
730 | ] |
|
752 | ] | |
731 |
|
753 | |||
732 | [[package]] |
|
754 | [[package]] | |
733 | name = "micro-timer" |
|
|||
734 | version = "0.4.0" |
|
|||
735 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
|||
736 | checksum = "5de32cb59a062672560d6f0842c4aa7714727457b9fe2daf8987d995a176a405" |
|
|||
737 | dependencies = [ |
|
|||
738 | "micro-timer-macros", |
|
|||
739 | "scopeguard", |
|
|||
740 | ] |
|
|||
741 |
|
||||
742 | [[package]] |
|
|||
743 | name = "micro-timer-macros" |
|
|||
744 | version = "0.4.0" |
|
|||
745 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
|||
746 | checksum = "cee948b94700125b52dfb68dd17c19f6326696c1df57f92c05ee857463c93ba1" |
|
|||
747 | dependencies = [ |
|
|||
748 | "proc-macro2", |
|
|||
749 | "quote", |
|
|||
750 | "scopeguard", |
|
|||
751 | "syn", |
|
|||
752 | ] |
|
|||
753 |
|
||||
754 | [[package]] |
|
|||
755 | name = "miniz_oxide" |
|
755 | name = "miniz_oxide" | |
756 | version = "0.5.4" |
|
756 | version = "0.5.4" | |
757 | source = "registry+https://github.com/rust-lang/crates.io-index" |
|
757 | source = "registry+https://github.com/rust-lang/crates.io-index" | |
@@ -1094,7 +1094,7 b' dependencies = [' | |||||
1094 | "home", |
|
1094 | "home", | |
1095 | "lazy_static", |
|
1095 | "lazy_static", | |
1096 | "log", |
|
1096 | "log", | |
1097 |
" |
|
1097 | "logging_timer", | |
1098 | "rayon", |
|
1098 | "rayon", | |
1099 | "regex", |
|
1099 | "regex", | |
1100 | "users", |
|
1100 | "users", |
@@ -19,6 +19,7 b' im-rc = "15.1.0"' | |||||
19 | itertools = "0.10.5" |
|
19 | itertools = "0.10.5" | |
20 | lazy_static = "1.4.0" |
|
20 | lazy_static = "1.4.0" | |
21 | libc = "0.2.137" |
|
21 | libc = "0.2.137" | |
|
22 | logging_timer = "1.1.0" | |||
22 | ouroboros = "0.15.5" |
|
23 | ouroboros = "0.15.5" | |
23 | rand = "0.8.5" |
|
24 | rand = "0.8.5" | |
24 | rand_pcg = "0.3.1" |
|
25 | rand_pcg = "0.3.1" | |
@@ -31,7 +32,6 b' same-file = "1.0.6"' | |||||
31 | tempfile = "3.3.0" |
|
32 | tempfile = "3.3.0" | |
32 | thread_local = "1.1.4" |
|
33 | thread_local = "1.1.4" | |
33 | crossbeam-channel = "0.5.6" |
|
34 | crossbeam-channel = "0.5.6" | |
34 | micro-timer = "0.4.0" |
|
|||
35 | log = "0.4.17" |
|
35 | log = "0.4.17" | |
36 | memmap2 = { version = "0.5.8", features = ["stable_deref_trait"] } |
|
36 | memmap2 = { version = "0.5.8", features = ["stable_deref_trait"] } | |
37 | zstd = "0.11.2" |
|
37 | zstd = "0.11.2" |
@@ -8,7 +8,6 b' use crate::utils::hg_path::HgPath;' | |||||
8 | use crate::{dirstate::EntryState, DirstateEntry, DirstateParents}; |
|
8 | use crate::{dirstate::EntryState, DirstateEntry, DirstateParents}; | |
9 | use byteorder::{BigEndian, WriteBytesExt}; |
|
9 | use byteorder::{BigEndian, WriteBytesExt}; | |
10 | use bytes_cast::{unaligned, BytesCast}; |
|
10 | use bytes_cast::{unaligned, BytesCast}; | |
11 | use micro_timer::timed; |
|
|||
12 |
|
11 | |||
13 | /// Parents are stored in the dirstate as byte hashes. |
|
12 | /// Parents are stored in the dirstate as byte hashes. | |
14 | pub const PARENT_SIZE: usize = 20; |
|
13 | pub const PARENT_SIZE: usize = 20; | |
@@ -29,7 +28,7 b' pub fn parse_dirstate_parents(' | |||||
29 | Ok(parents) |
|
28 | Ok(parents) | |
30 | } |
|
29 | } | |
31 |
|
30 | |||
32 | #[timed] |
|
31 | #[logging_timer::time("trace")] | |
33 | pub fn parse_dirstate(contents: &[u8]) -> Result<ParseResult, HgError> { |
|
32 | pub fn parse_dirstate(contents: &[u8]) -> Result<ParseResult, HgError> { | |
34 | let mut copies = Vec::new(); |
|
33 | let mut copies = Vec::new(); | |
35 | let mut entries = Vec::new(); |
|
34 | let mut entries = Vec::new(); |
@@ -1,5 +1,4 b'' | |||||
1 | use bytes_cast::BytesCast; |
|
1 | use bytes_cast::BytesCast; | |
2 | use micro_timer::timed; |
|
|||
3 | use std::borrow::Cow; |
|
2 | use std::borrow::Cow; | |
4 | use std::path::PathBuf; |
|
3 | use std::path::PathBuf; | |
5 |
|
4 | |||
@@ -454,7 +453,7 b" impl<'on_disk> DirstateMap<'on_disk> {" | |||||
454 | } |
|
453 | } | |
455 | } |
|
454 | } | |
456 |
|
455 | |||
457 | #[timed] |
|
456 | #[logging_timer::time("trace")] | |
458 | pub fn new_v2( |
|
457 | pub fn new_v2( | |
459 | on_disk: &'on_disk [u8], |
|
458 | on_disk: &'on_disk [u8], | |
460 | data_size: usize, |
|
459 | data_size: usize, | |
@@ -467,7 +466,7 b" impl<'on_disk> DirstateMap<'on_disk> {" | |||||
467 | } |
|
466 | } | |
468 | } |
|
467 | } | |
469 |
|
468 | |||
470 | #[timed] |
|
469 | #[logging_timer::time("trace")] | |
471 | pub fn new_v1( |
|
470 | pub fn new_v1( | |
472 | on_disk: &'on_disk [u8], |
|
471 | on_disk: &'on_disk [u8], | |
473 | ) -> Result<(Self, Option<DirstateParents>), DirstateError> { |
|
472 | ) -> Result<(Self, Option<DirstateParents>), DirstateError> { | |
@@ -1208,7 +1207,7 b' impl OwningDirstateMap {' | |||||
1208 | }) |
|
1207 | }) | |
1209 | } |
|
1208 | } | |
1210 |
|
1209 | |||
1211 | #[timed] |
|
1210 | #[logging_timer::time("trace")] | |
1212 | pub fn pack_v1( |
|
1211 | pub fn pack_v1( | |
1213 | &self, |
|
1212 | &self, | |
1214 | parents: DirstateParents, |
|
1213 | parents: DirstateParents, | |
@@ -1248,7 +1247,7 b' impl OwningDirstateMap {' | |||||
1248 | /// appended to the existing data file whose content is at |
|
1247 | /// appended to the existing data file whose content is at | |
1249 | /// `map.on_disk` (true), instead of written to a new data file |
|
1248 | /// `map.on_disk` (true), instead of written to a new data file | |
1250 | /// (false), and the previous size of data on disk. |
|
1249 | /// (false), and the previous size of data on disk. | |
1251 | #[timed] |
|
1250 | #[logging_timer::time("trace")] | |
1252 | pub fn pack_v2( |
|
1251 | pub fn pack_v2( | |
1253 | &self, |
|
1252 | &self, | |
1254 | can_append: bool, |
|
1253 | can_append: bool, |
@@ -19,7 +19,6 b' use crate::HgPathCow;' | |||||
19 | use crate::PatternFileWarning; |
|
19 | use crate::PatternFileWarning; | |
20 | use crate::StatusError; |
|
20 | use crate::StatusError; | |
21 | use crate::StatusOptions; |
|
21 | use crate::StatusOptions; | |
22 | use micro_timer::timed; |
|
|||
23 | use once_cell::sync::OnceCell; |
|
22 | use once_cell::sync::OnceCell; | |
24 | use rayon::prelude::*; |
|
23 | use rayon::prelude::*; | |
25 | use sha1::{Digest, Sha1}; |
|
24 | use sha1::{Digest, Sha1}; | |
@@ -39,7 +38,7 b' use std::time::SystemTime;' | |||||
39 | /// and its use of `itertools::merge_join_by`. When reaching a path that only |
|
38 | /// and its use of `itertools::merge_join_by`. When reaching a path that only | |
40 | /// exists in one of the two trees, depending on information requested by |
|
39 | /// exists in one of the two trees, depending on information requested by | |
41 | /// `options` we may need to traverse the remaining subtree. |
|
40 | /// `options` we may need to traverse the remaining subtree. | |
42 | #[timed] |
|
41 | #[logging_timer::time("trace")] | |
43 | pub fn status<'dirstate>( |
|
42 | pub fn status<'dirstate>( | |
44 | dmap: &'dirstate mut DirstateMap, |
|
43 | dmap: &'dirstate mut DirstateMap, | |
45 | matcher: &(dyn Matcher + Sync), |
|
44 | matcher: &(dyn Matcher + Sync), |
@@ -48,10 +48,6 b' use std::collections::HashMap;' | |||||
48 | use std::fmt; |
|
48 | use std::fmt; | |
49 | use twox_hash::RandomXxHashBuilder64; |
|
49 | use twox_hash::RandomXxHashBuilder64; | |
50 |
|
50 | |||
51 | /// This is a contract between the `micro-timer` crate and us, to expose |
|
|||
52 | /// the `log` crate as `crate::log`. |
|
|||
53 | use log; |
|
|||
54 |
|
||||
55 | pub type LineNumber = usize; |
|
51 | pub type LineNumber = usize; | |
56 |
|
52 | |||
57 | /// Rust's default hasher is too slow because it tries to prevent collision |
|
53 | /// Rust's default hasher is too slow because it tries to prevent collision |
@@ -30,8 +30,6 b' use std::fmt::{Display, Error, Formatter' | |||||
30 | use std::ops::Deref; |
|
30 | use std::ops::Deref; | |
31 | use std::path::{Path, PathBuf}; |
|
31 | use std::path::{Path, PathBuf}; | |
32 |
|
32 | |||
33 | use micro_timer::timed; |
|
|||
34 |
|
||||
35 | #[derive(Debug, PartialEq)] |
|
33 | #[derive(Debug, PartialEq)] | |
36 | pub enum VisitChildrenSet { |
|
34 | pub enum VisitChildrenSet { | |
37 | /// Don't visit anything |
|
35 | /// Don't visit anything | |
@@ -611,7 +609,7 b' impl RegexMatcher {' | |||||
611 | /// This can fail when the pattern is invalid or not supported by the |
|
609 | /// This can fail when the pattern is invalid or not supported by the | |
612 | /// underlying engine (the `regex` crate), for instance anything with |
|
610 | /// underlying engine (the `regex` crate), for instance anything with | |
613 | /// back-references. |
|
611 | /// back-references. | |
614 | #[timed] |
|
612 | #[logging_timer::time("trace")] | |
615 | fn re_matcher(pattern: &[u8]) -> PatternResult<RegexMatcher> { |
|
613 | fn re_matcher(pattern: &[u8]) -> PatternResult<RegexMatcher> { | |
616 | use std::io::Write; |
|
614 | use std::io::Write; | |
617 |
|
615 |
@@ -16,7 +16,7 b' derive_more = "0.99.17"' | |||||
16 | home = "0.5.4" |
|
16 | home = "0.5.4" | |
17 | lazy_static = "1.4.0" |
|
17 | lazy_static = "1.4.0" | |
18 | log = "0.4.17" |
|
18 | log = "0.4.17" | |
19 |
|
|
19 | logging_timer = "1.1.0" | |
20 | regex = "1.7.0" |
|
20 | regex = "1.7.0" | |
21 | env_logger = "0.9.3" |
|
21 | env_logger = "0.9.3" | |
22 | format-bytes = "0.3.0" |
|
22 | format-bytes = "0.3.0" |
@@ -3,7 +3,6 b' use clap::Arg;' | |||||
3 | use format_bytes::format_bytes; |
|
3 | use format_bytes::format_bytes; | |
4 | use hg::operations::cat; |
|
4 | use hg::operations::cat; | |
5 | use hg::utils::hg_path::HgPathBuf; |
|
5 | use hg::utils::hg_path::HgPathBuf; | |
6 | use micro_timer::timed; |
|
|||
7 | use std::ffi::OsString; |
|
6 | use std::ffi::OsString; | |
8 | use std::os::unix::prelude::OsStrExt; |
|
7 | use std::os::unix::prelude::OsStrExt; | |
9 |
|
8 | |||
@@ -31,7 +30,7 b' pub fn args() -> clap::Command {' | |||||
31 | .about(HELP_TEXT) |
|
30 | .about(HELP_TEXT) | |
32 | } |
|
31 | } | |
33 |
|
32 | |||
34 | #[timed] |
|
33 | #[logging_timer::time("trace")] | |
35 | pub fn run(invocation: &crate::CliInvocation) -> Result<(), CommandError> { |
|
34 | pub fn run(invocation: &crate::CliInvocation) -> Result<(), CommandError> { | |
36 | let cat_enabled_default = true; |
|
35 | let cat_enabled_default = true; | |
37 | let cat_enabled = invocation.config.get_option(b"rhg", b"cat")?; |
|
36 | let cat_enabled = invocation.config.get_option(b"rhg", b"cat")?; |
@@ -2,7 +2,6 b' 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 micro_timer::timed; |
|
|||
6 |
|
5 | |||
7 | pub const HELP_TEXT: &str = " |
|
6 | pub const HELP_TEXT: &str = " | |
8 | Dump the contents of a data file revision |
|
7 | Dump the contents of a data file revision | |
@@ -36,7 +35,7 b' pub fn args() -> clap::Command {' | |||||
36 | .about(HELP_TEXT) |
|
35 | .about(HELP_TEXT) | |
37 | } |
|
36 | } | |
38 |
|
37 | |||
39 | #[timed] |
|
38 | #[logging_timer::time("trace")] | |
40 | pub fn run(invocation: &crate::CliInvocation) -> Result<(), CommandError> { |
|
39 | pub fn run(invocation: &crate::CliInvocation) -> Result<(), CommandError> { | |
41 | let args = invocation.subcommand_args; |
|
40 | let args = invocation.subcommand_args; | |
42 | let rev = args |
|
41 | let rev = args |
General Comments 0
You need to be logged in to leave comments.
Login now