Show More
@@ -1,125 +1,120 | |||
|
1 | 1 | Mercurial can be augmented with Rust extensions for speeding up certain |
|
2 | 2 | operations. |
|
3 | 3 | |
|
4 | 4 | Word of Caution |
|
5 | 5 | =============== |
|
6 | 6 | |
|
7 | 7 | Using the Rust extension might result in the use of various repository formats |
|
8 | 8 | that are not supported by non-Rust mercurial. When using a Mercurial |
|
9 | 9 | without Rust support on the same repositories, you might need to downgrade your |
|
10 | 10 | repository formats and/or activate cripplingly slow paths for compatibility. |
|
11 | 11 | For details, see: |
|
12 | 12 | |
|
13 | 13 | - :hg:`help config.format.use-persistent-nodemap` |
|
14 | 14 | - :hg:`help config.format.use-dirstate-v2` |
|
15 | 15 | |
|
16 | 16 | In addition, while the tests are run with the Rust code, there might be |
|
17 | 17 | subtle undetected divergences from the historical non-Rust code. So keep |
|
18 | 18 | your eyes open and report any oddity. Rust is not considered a first class |
|
19 | 19 | citizen to the project yet. |
|
20 | 20 | |
|
21 | 21 | Compatibility |
|
22 | 22 | ============= |
|
23 | 23 | |
|
24 | 24 | Though the Rust extensions are only tested by the project under Linux, users of |
|
25 | 25 | MacOS, FreeBSD and other UNIX-likes have been using the Rust extensions. Your |
|
26 | 26 | mileage may vary, but by all means do give us feedback or signal your interest |
|
27 | 27 | for better support. |
|
28 | 28 | |
|
29 | 29 | For compatibility with non-Rust version of Mercurial check the previous "Word of |
|
30 | 30 | Caution" section. |
|
31 | 31 | |
|
32 | 32 | No Rust extensions are available for Windows at this time. |
|
33 | 33 | |
|
34 | 34 | Features |
|
35 | 35 | ======== |
|
36 | 36 | |
|
37 | 37 | The following operations are sped up when using Rust: |
|
38 | 38 | |
|
39 | 39 | - discovery of differences between repositories (pull/push) |
|
40 | 40 | - nodemap (see :hg:`help config.format.use-persistent-nodemap`) |
|
41 | 41 | - all commands using the dirstate (status, commit, diff, add, update, etc.) |
|
42 | 42 | - dirstate-v2 (see :hg:`help config.format.use-dirstate-v2`) |
|
43 | 43 | - iteration over ancestors in a graph |
|
44 | 44 | |
|
45 | 45 | More features are in the works, and improvements on the above listed are still |
|
46 | 46 | in progress. For more experimental work see the "rhg" section. |
|
47 | 47 | |
|
48 | 48 | Checking for Rust |
|
49 | 49 | ================= |
|
50 | 50 | |
|
51 | 51 | You may already have the Rust extensions depending on how you install |
|
52 | 52 | Mercurial:: |
|
53 | 53 | |
|
54 | 54 | $ hg debuginstall | grep -i rust |
|
55 | 55 | checking Rust extensions (installed) |
|
56 | 56 | checking module policy (rust+c-allow) |
|
57 | 57 | |
|
58 | 58 | If those lines don't even exist, you're using an old version of `hg` which does |
|
59 | 59 | not have any Rust extensions yet. |
|
60 | 60 | |
|
61 | 61 | Installing |
|
62 | 62 | ========== |
|
63 | 63 | |
|
64 | 64 | You will need `cargo` to be in your `$PATH`. See the "MSRV" section for which |
|
65 | 65 | version to use. |
|
66 | 66 | |
|
67 | 67 | Using pip |
|
68 | 68 | --------- |
|
69 | 69 | |
|
70 | Users of `pip` can install the Rust extensions with the following command:: | |
|
71 | ||
|
72 | $ pip install mercurial \ | |
|
73 | --global-option \ | |
|
74 | --rust \ | |
|
75 | --no-use-pep517 \ | |
|
76 | --no-binary mercurial | |
|
70 | Users of `pip` can install the Rust extensions with the following commands:: | |
|
77 | 71 | |
|
78 | `--no-use-pep517` is here to tell `pip` to preserve backwards compatibility with | |
|
79 | the legacy `setup.py` system. Mercurial has not yet migrated its complex setup | |
|
80 | to the new system, so we still need this to add compiled extensions. | |
|
72 | $ pip cache remove mercurial | |
|
73 | $ pip install mercurial -v \ | |
|
74 | --config-settings --global-option=--rust \ | |
|
75 | --no-binary mercurial --force | |
|
81 | 76 | |
|
82 |
`--no-binary` |
|
|
83 |
missing rust support. This might take a couple |
|
|
84 | compiling everything. | |
|
77 | `pip cache remove` and `--no-binary` are there to tell pip to not use the | |
|
78 | pre-compiled wheels that are missing rust support. This might take a couple | |
|
79 | of minutes because you're compiling everything. | |
|
85 | 80 | |
|
86 | 81 | See the "Checking for Rust" section to see if the install succeeded. |
|
87 | 82 | |
|
88 | 83 | From your distribution |
|
89 | 84 | ---------------------- |
|
90 | 85 | |
|
91 | 86 | Some distributions are shipping Mercurial with Rust extensions enabled and |
|
92 | 87 | pre-compiled (meaning you won't have to install `cargo`), or allow you to |
|
93 | 88 | specify an install flag. Check with your specific distribution for how to do |
|
94 | 89 | that, or ask their team to add support for hg+Rust! |
|
95 | 90 | |
|
96 | 91 | From source |
|
97 | 92 | ----------- |
|
98 | 93 | |
|
99 | 94 | Please refer to the `rust/README.rst` file in the Mercurial repository for |
|
100 | 95 | instructions on how to install from source. |
|
101 | 96 | |
|
102 | 97 | MSRV |
|
103 | 98 | ==== |
|
104 | 99 | |
|
105 | 100 | The minimum supported Rust version is defined in `rust/clippy.toml`. |
|
106 | 101 | The project's policy is to keep it at or below the version from Debian testing, |
|
107 | 102 | to make the distributions' job easier. |
|
108 | 103 | |
|
109 | 104 | rhg |
|
110 | 105 | === |
|
111 | 106 | |
|
112 | 107 | There exists an experimental pure-Rust version of Mercurial called `rhg` with a |
|
113 | 108 | fallback mechanism for unsupported invocations. It allows for much faster |
|
114 | 109 | execution of certain commands while adding no discernable overhead for the rest. |
|
115 | 110 | |
|
116 | 111 | The only way of trying it out is by building it from source. Please refer to |
|
117 | 112 | `rust/README.rst` in the Mercurial repository. |
|
118 | 113 | |
|
119 | 114 | See `hg help config.rhg` for configuration options. |
|
120 | 115 | |
|
121 | 116 | Contributing |
|
122 | 117 | ============ |
|
123 | 118 | |
|
124 | 119 | If you would like to help the Rust endeavor, please refer to `rust/README.rst` |
|
125 | 120 | in the Mercurial repository. |
General Comments 0
You need to be logged in to leave comments.
Login now