comparison mercurial/helptext/rust.txt @ 48532:7ccd31fda132 stable

docs: add documentation about Rust This makes the features more discoverable for users. Differential Revision: https://phab.mercurial-scm.org/D11808
author Raphaël Gomès <rgomes@octobus.net>
date Fri, 26 Nov 2021 14:28:27 +0100
parents
children 2b271cab2d1c
comparison
equal deleted inserted replaced
48522:b52cf5063865 48532:7ccd31fda132
1 Mercurial can be augmented with Rust extensions for speeding up certain
2 operations.
3
4 Compatibility
5 =============
6
7 Though the Rust extensions are only tested by the project under Linux, users of
8 MacOS, FreeBSD and other UNIX-likes have been using the Rust extensions. Your
9 mileage may vary, but by all means do give us feedback or signal your interest
10 for better support.
11
12 No Rust extensions are available for Windows at this time.
13
14 Features
15 ========
16
17 The following operations are sped up when using Rust:
18 - discovery of differences between repositories (pull/push)
19 - nodemap (see :hg:`help config.format.use-persistent-nodemap`)
20 - all commands using the dirstate (status, commit, diff, add, update, etc.)
21 - dirstate-v2 (see :hg:`help config.format.exp-rc-dirstate-v2`)
22 - iteration over ancestors in a graph
23
24 More features are in the works, and improvements on the above listed are still
25 in progress. For more experimental work see the "rhg" section.
26
27 Checking for Rust
28 =================
29
30 You may already have the Rust extensions depending on how you install Mercurial.
31
32 $ hg debuginstall | grep -i rust
33 checking Rust extensions (installed)
34 checking module policy (rust+c-allow)
35
36 If those lines don't even exist, you're using an old version of `hg` which does
37 not have any Rust extensions yet.
38
39 Installing
40 ==========
41
42 You will need `cargo` to be in your `$PATH`. See the "MSRV" section for which
43 version to use.
44
45 Using pip
46 ---------
47
48 Users of `pip` can install the Rust extensions with the following command:
49
50 $ pip install mercurial --global-option --rust --no-use-pep517
51
52 `--no-use-pep517` is here to tell `pip` to preserve backwards compatibility with
53 the legacy `setup.py` system. Mercurial has not yet migrated its complex setup
54 to the new system, so we still need this to add compiled extensions.
55
56 This might take a couple of minutes because you're compiling everything.
57
58 See the "Checking for Rust" section to see if the install succeeded.
59
60 From your distribution
61 ----------------------
62
63 Some distributions are shipping Mercurial with Rust extensions enabled and
64 pre-compiled (meaning you won't have to install `cargo`), or allow you to
65 specify an install flag. Check with your specific distribution for how to do
66 that, or ask their team to add support for hg+Rust!
67
68 From source
69 -----------
70
71 Please refer to the `rust/README.rst` file in the Mercurial repository for
72 instructions on how to install from source.
73
74 MSRV
75 ====
76
77 The minimum supported Rust version is currently 1.48.0. The project's policy is
78 to follow the version from Debian stable, to make the distributions' job easier.
79
80 rhg
81 ===
82
83 There exists an experimental pure-Rust version of Mercurial called `rhg` with a
84 fallback mechanism for unsupported invocations. It allows for much faster
85 execution of certain commands while adding no discernable overhead for the rest.
86
87 The only way of trying it out is by building it from source. Please refer to
88 `rust/README.rst` in the Mercurial repository.
89
90 Contributing
91 ============
92
93 If you would like to help the Rust endeavor, please refer to `rust/README.rst`
94 in the Mercurial repository.