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