Mercurial > public > mercurial-scm > hg-stable
annotate rust/hg-core/src/lib.rs @ 53040:cdd7bf612c7b stable tip
bundle-spec: properly format boolean parameter (issue6960)
This was breaking automatic clone bundle generation. This changeset fixes it and
add a test to catch it in the future.
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 11 Mar 2025 02:29:42 +0100 |
parents | bbf1c52252ae |
children |
rev | line source |
---|---|
44006
cb2e2b095dc9
rust-core: updated copyright notice
Georges Racinet <georges.racinet@octobus.net>
parents:
43922
diff
changeset
|
1 // Copyright 2018-2020 Georges Racinet <georges.racinet@octobus.net> |
cb2e2b095dc9
rust-core: updated copyright notice
Georges Racinet <georges.racinet@octobus.net>
parents:
43922
diff
changeset
|
2 // and Mercurial contributors |
40271
dbc28c91f7ff
rust: pure Rust lazyancestors iterator
Georges Racinet <gracinet@anybox.fr>
parents:
diff
changeset
|
3 // |
dbc28c91f7ff
rust: pure Rust lazyancestors iterator
Georges Racinet <gracinet@anybox.fr>
parents:
diff
changeset
|
4 // This software may be used and distributed according to the terms of the |
dbc28c91f7ff
rust: pure Rust lazyancestors iterator
Georges Racinet <gracinet@anybox.fr>
parents:
diff
changeset
|
5 // GNU General Public License version 2 or any later version. |
46511
43d63979a75e
rust: use HgError in RevlogError and Vfs
Simon Sapin <simon.sapin@octobus.net>
parents:
46508
diff
changeset
|
6 |
40271
dbc28c91f7ff
rust: pure Rust lazyancestors iterator
Georges Racinet <gracinet@anybox.fr>
parents:
diff
changeset
|
7 mod ancestors; |
52769
1b7a57a5b47a
rust: add safe bindings to bdiff.c
Mitchell Kember <mkember@janestreet.com>
parents:
52582
diff
changeset
|
8 mod bdiff; |
41242
47881d2a9d99
rust: dagop.headrevs() Rust counterparts
Georges Racinet on ishtar.racinet.fr <georges@racinet.fr>
parents:
41241
diff
changeset
|
9 pub mod dagops; |
52770
bbf1c52252ae
rust: add encoding.rs
Mitchell Kember <mkember@janestreet.com>
parents:
52769
diff
changeset
|
10 pub mod encoding; |
46506
39e9407820ac
rust: Introduce an `HgError` enum for common error cases
Simon Sapin <simon.sapin@octobus.net>
parents:
46503
diff
changeset
|
11 pub mod errors; |
49502
7c93e38a0bbd
rhg-status: add support for narrow clones
Rapha?l Gom?s <rgomes@octobus.net>
parents:
49499
diff
changeset
|
12 pub mod narrow; |
49499
ffd4b1f1c9cb
rhg: add sparse support
Rapha?l Gom?s <rgomes@octobus.net>
parents:
49041
diff
changeset
|
13 pub mod sparse; |
48557
791f5d5f7a96
hg-core: dedup LazyAncestors Iterator impl
pacien <pacien.trangirard@pacien.net>
parents:
48463
diff
changeset
|
14 pub use ancestors::{AncestorsIterator, MissingAncestors}; |
47115
5d62243c7732
rust: Add a Timestamp struct instead of abusing Duration
Simon Sapin <simon.sapin@octobus.net>
parents:
47107
diff
changeset
|
15 pub mod dirstate; |
42216
10b465d61556
rust-discovery: starting core implementation
Georges Racinet <georges.racinet@octobus.net>
parents:
41728
diff
changeset
|
16 pub mod discovery; |
47413
6e49769b7f97
rhg: add exit code to HgError::Abort()
Pulkit Goyal <7895pulkit@gmail.com>
parents:
47343
diff
changeset
|
17 pub mod exit_codes; |
52296
1a8466fd904a
hg-core: add fncache module
Rapha?l Gom?s <rgomes@octobus.net>
parents:
52290
diff
changeset
|
18 pub mod fncache; |
45939
a2eda1ff22aa
requirements: move loading to hg-core and add parsing
Simon Sapin <simon-commits@exyr.org>
parents:
45384
diff
changeset
|
19 pub mod requirements; |
42330
e240bec26626
rust-dirstate: add rust-cpython bindings to the new parse/pack functions
Rapha?l Gom?s <rgomes@octobus.net>
parents:
42329
diff
changeset
|
20 pub mod testing; // unconditionally built, for use from integration tests |
52336
04b9a56c2d25
rust-lib: only export very common types to the top of the crate
Rapha?l Gom?s <rgomes@octobus.net>
parents:
52335
diff
changeset
|
21 |
04b9a56c2d25
rust-lib: only export very common types to the top of the crate
Rapha?l Gom?s <rgomes@octobus.net>
parents:
52335
diff
changeset
|
22 // Export very common type to make discovery easier |
04b9a56c2d25
rust-lib: only export very common types to the top of the crate
Rapha?l Gom?s <rgomes@octobus.net>
parents:
52335
diff
changeset
|
23 pub use dirstate::DirstateParents; |
45959
595979dc924e
copies: introduce a basic Rust function for `combine_changeset_copies`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
45939
diff
changeset
|
24 pub mod copy_tracing; |
50890
c112cc9effdc
rhg: support "status FILE"
Spencer Baugh <sbaugh@janestreet.com>
parents:
50884
diff
changeset
|
25 pub mod filepatterns; |
43490
a77d4fe347a4
rust-matchers: add `Matcher` trait and implement `AlwaysMatcher`
Rapha?l Gom?s <rgomes@octobus.net>
parents:
43271
diff
changeset
|
26 pub mod matchers; |
46167
8a4914397d02
rust: introduce Repo and Vfs types for filesystem abstraction
Simon Sapin <simon.sapin@octobus.net>
parents:
45959
diff
changeset
|
27 pub mod repo; |
44008
6b332c1fc7fe
rust-core: extracted a revlog submodule
Georges Racinet <georges.racinet@octobus.net>
parents:
44006
diff
changeset
|
28 pub mod revlog; |
52308
bd8081e9fd62
rust: don't star export from the `revlog` module
Rapha?l Gom?s <rgomes@octobus.net>
parents:
52296
diff
changeset
|
29 // Export very common types to make discovery easier |
bd8081e9fd62
rust: don't star export from the `revlog` module
Rapha?l Gom?s <rgomes@octobus.net>
parents:
52296
diff
changeset
|
30 pub use revlog::{ |
bd8081e9fd62
rust: don't star export from the `revlog` module
Rapha?l Gom?s <rgomes@octobus.net>
parents:
52296
diff
changeset
|
31 BaseRevision, Graph, GraphError, Node, NodePrefix, Revision, |
bd8081e9fd62
rust: don't star export from the `revlog` module
Rapha?l Gom?s <rgomes@octobus.net>
parents:
52296
diff
changeset
|
32 UncheckedRevision, NULL_NODE, NULL_NODE_ID, NULL_REVISION, |
bd8081e9fd62
rust: don't star export from the `revlog` module
Rapha?l Gom?s <rgomes@octobus.net>
parents:
52296
diff
changeset
|
33 WORKING_DIRECTORY_HEX, WORKING_DIRECTORY_REVISION, |
bd8081e9fd62
rust: don't star export from the `revlog` module
Rapha?l Gom?s <rgomes@octobus.net>
parents:
52296
diff
changeset
|
34 }; |
49970
678588b01af1
rhg: implement checkexec to support weird filesystems
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
49502
diff
changeset
|
35 pub mod checkexec; |
46187
95d6f31e88db
hg-core: add basic config module
Rapha?l Gom?s <rgomes@octobus.net>
parents:
46167
diff
changeset
|
36 pub mod config; |
48463
5734b03ecf3e
rhg: Initial repository locking
Simon Sapin <simon.sapin@octobus.net>
parents:
48083
diff
changeset
|
37 pub mod lock; |
46638
1f55cd5b292f
rust: Add a log file rotation utility
Simon Sapin <simon.sapin@octobus.net>
parents:
46512
diff
changeset
|
38 pub mod logging; |
44999
a46e36b82461
hg-core: add Operation interface for high-level hg operations
Antoine Cezar <antoine.cezar@octobus.net>
parents:
44929
diff
changeset
|
39 pub mod operations; |
52582
1866119cbad7
rust-ignore: construct regex Hir object directly, avoiding large regex string
Arseniy Alekseyev <aalekseyev@janestreet.com>
parents:
52339
diff
changeset
|
40 mod pre_regex; |
52065
3ae7c43ad8aa
rust: add `Progress` trait for progress bars
Rapha?l Gom?s <rgomes@octobus.net>
parents:
51630
diff
changeset
|
41 pub mod progress; |
46501
4b381dbbf8b7
rhg: centralize parsing of `--rev` CLI arguments
Simon Sapin <simon.sapin@octobus.net>
parents:
46441
diff
changeset
|
42 pub mod revset; |
52290
e01e84e5e426
rust-revlog: add a Rust-only `InnerRevlog`
Rapha?l Gom?s <rgomes@octobus.net>
parents:
52084
diff
changeset
|
43 pub mod transaction; |
52084
8b7123c8947b
update: add a Rust fast-path when updating from null (and clean)
Rapha?l Gom?s <rgomes@octobus.net>
parents:
52065
diff
changeset
|
44 pub mod update; |
42610
5672bb73f61e
rust-utils: add docstrings and doctests for utils.rs
Rapha?l Gom?s <rgomes@octobus.net>
parents:
42609
diff
changeset
|
45 pub mod utils; |
47980
9cd35c8c6044
rust: Move VFS code to its own module
Simon Sapin <simon.sapin@octobus.net>
parents:
47413
diff
changeset
|
46 pub mod vfs; |
52183
96b113d22b34
rust-update: handle SIGINT from long-running update threads
Rapha?l Gom?s <rgomes@octobus.net>
parents:
52084
diff
changeset
|
47 use std::{collections::HashMap, sync::atomic::AtomicBool}; |
43844
5ac243a92e37
rust-performance: introduce FastHashMap type alias for HashMap
Rapha?l Gom?s <rgomes@octobus.net>
parents:
43808
diff
changeset
|
48 use twox_hash::RandomXxHashBuilder64; |
40271
dbc28c91f7ff
rust: pure Rust lazyancestors iterator
Georges Racinet <gracinet@anybox.fr>
parents:
diff
changeset
|
49 |
52183
96b113d22b34
rust-update: handle SIGINT from long-running update threads
Rapha?l Gom?s <rgomes@octobus.net>
parents:
52084
diff
changeset
|
50 /// Used to communicate with threads spawned from code within this crate that |
96b113d22b34
rust-update: handle SIGINT from long-running update threads
Rapha?l Gom?s <rgomes@octobus.net>
parents:
52084
diff
changeset
|
51 /// they should stop their work (SIGINT was received). |
96b113d22b34
rust-update: handle SIGINT from long-running update threads
Rapha?l Gom?s <rgomes@octobus.net>
parents:
52084
diff
changeset
|
52 pub static INTERRUPT_RECEIVED: AtomicBool = AtomicBool::new(false); |
96b113d22b34
rust-update: handle SIGINT from long-running update threads
Rapha?l Gom?s <rgomes@octobus.net>
parents:
52084
diff
changeset
|
53 |
42349
e8f3740cc067
rust-filepatterns: add a Rust implementation of pattern-related utils
Rapha?l Gom?s <rgomes@octobus.net>
parents:
42330
diff
changeset
|
54 pub type LineNumber = usize; |
e8f3740cc067
rust-filepatterns: add a Rust implementation of pattern-related utils
Rapha?l Gom?s <rgomes@octobus.net>
parents:
42330
diff
changeset
|
55 |
43844
5ac243a92e37
rust-performance: introduce FastHashMap type alias for HashMap
Rapha?l Gom?s <rgomes@octobus.net>
parents:
43808
diff
changeset
|
56 /// Rust's default hasher is too slow because it tries to prevent collision |
5ac243a92e37
rust-performance: introduce FastHashMap type alias for HashMap
Rapha?l Gom?s <rgomes@octobus.net>
parents:
43808
diff
changeset
|
57 /// attacks. We are not concerned about those: if an ill-minded person has |
5ac243a92e37
rust-performance: introduce FastHashMap type alias for HashMap
Rapha?l Gom?s <rgomes@octobus.net>
parents:
43808
diff
changeset
|
58 /// write access to your repository, you have other issues. |
5ac243a92e37
rust-performance: introduce FastHashMap type alias for HashMap
Rapha?l Gom?s <rgomes@octobus.net>
parents:
43808
diff
changeset
|
59 pub type FastHashMap<K, V> = HashMap<K, V, RandomXxHashBuilder64>; |
5ac243a92e37
rust-performance: introduce FastHashMap type alias for HashMap
Rapha?l Gom?s <rgomes@octobus.net>
parents:
43808
diff
changeset
|
60 |
49041
11c0411bf4e2
dirstate-tree: optimize HashMap lookups with raw_entry_mut
Simon Sapin <simon.sapin@octobus.net>
parents:
48557
diff
changeset
|
61 // TODO: should this be the default `FastHashMap` for all of hg-core, not just |
52334
db065b33fa56
rust-dirstate: merge `dirstate_tree` module into `dirstate`
Rapha?l Gom?s <rgomes@octobus.net>
parents:
52313
diff
changeset
|
62 // dirstate? How does XxHash compare with AHash, hashbrown’s default? |
49041
11c0411bf4e2
dirstate-tree: optimize HashMap lookups with raw_entry_mut
Simon Sapin <simon.sapin@octobus.net>
parents:
48557
diff
changeset
|
63 pub type FastHashbrownMap<K, V> = |
11c0411bf4e2
dirstate-tree: optimize HashMap lookups with raw_entry_mut
Simon Sapin <simon.sapin@octobus.net>
parents:
48557
diff
changeset
|
64 hashbrown::HashMap<K, V, RandomXxHashBuilder64>; |