Debian Codegraph @

rust/hg-core/src/lib.rs

raw
1 // Copyright 2018-2020 Georges Racinet <[email protected]>
2 // and Mercurial contributors
3 //
4 // This software may be used and distributed according to the terms of the
5 // GNU General Public License version 2 or any later version.
6
7 mod ancestors;
8 mod bdiff;
9 pub mod dagops;
10 pub mod encoding;
11 pub mod errors;
12 pub mod narrow;
13 pub mod sparse;
14 pub use ancestors::AncestorsIterator;
15 pub use ancestors::MissingAncestors;
16 pub mod dirstate;
17 pub mod discovery;
18 pub mod exit_codes;
19 pub mod file_index;
20 pub mod requirements;
21 pub mod testing; // unconditionally built, for use from integration tests
22
23 // Export very common type to make discovery easier
24 pub use dirstate::DirstateParents;
25 pub mod copy_tracing;
26 pub mod file_patterns;
27 pub mod matchers;
28 pub mod repo;
29 pub mod revlog;
30 // Export very common types to make discovery easier
31 pub use revlog::BaseRevision;
32 pub use revlog::Graph;
33 pub use revlog::GraphError;
34 pub use revlog::Node;
35 pub use revlog::NodePrefix;
36 pub use revlog::Revision;
37 pub use revlog::UncheckedRevision;
38 pub use revlog::NULL_NODE;
39 pub use revlog::NULL_NODE_ID;
40 pub use revlog::NULL_REVISION;
41 pub use revlog::WORKING_DIRECTORY_HEX;
42 pub use revlog::WORKING_DIRECTORY_REVISION;
43 pub mod checkexec;
44 pub mod config;
45 pub mod dyn_bytes;
46 pub mod lock;
47 pub mod logging;
48 pub mod operations;
49 mod pre_regex;
50 pub mod progress;
51 pub mod revset;
52 pub mod transaction;
53 pub mod update;
54 pub mod utils;
55 pub mod vfs;
56 pub mod warnings;
57 use std::collections::HashMap;
58 use std::sync::atomic::AtomicBool;
59
60 use twox_hash::xxhash64::RandomState;
61
62 /// Used to communicate with threads spawned from code within this crate that
63 /// they should stop their work (SIGINT was received).
64 pub static INTERRUPT_RECEIVED: AtomicBool = AtomicBool::new(false);
65
66 pub type LineNumber = usize;
67
68 /// Rust's default hasher is too slow because it tries to prevent collision
69 /// attacks. We are not concerned about those: if an ill-minded person has
70 /// write access to your repository, you have other issues.
71 pub type FastHashMap<K, V> = HashMap<K, V, RandomState>;
72
73 // TODO: should this be the default `FastHashMap` for all of hg-core, not just
74 // dirstate? How does XxHash compare with AHash, hashbrown’s default?
75 pub type FastHashbrownMap<K, V> = hashbrown::HashMap<K, V, RandomState>;