rust.txt
125 lines
| 4.1 KiB
| text/plain
|
TextLexer
Raphaël Gomès
|
r49364 | Mercurial can be augmented with Rust extensions for speeding up certain | ||
operations. | ||||
r53171 | Word of Caution | |||
=============== | ||||
Using the Rust extension might result in the use of various repository formats | ||||
that are not supported by non-Rust mercurial. When using a Mercurial | ||||
without Rust support on the same repositories, you might need to downgrade your | ||||
repository formats and/or activate cripplingly slow paths for compatibility. | ||||
For details, see: | ||||
- :hg:`help config.format.use-persistent-nodemap` | ||||
- :hg:`help config.format.use-dirstate-v2` | ||||
In addition, while the tests are run with the Rust code, there might be | ||||
subtle undetected divergences from the historical non-Rust code. So keep | ||||
your eyes open and report any oddity. Rust is not considered a first class | ||||
citizen to the project yet. | ||||
Raphaël Gomès
|
r49364 | Compatibility | ||
============= | ||||
Though the Rust extensions are only tested by the project under Linux, users of | ||||
MacOS, FreeBSD and other UNIX-likes have been using the Rust extensions. Your | ||||
mileage may vary, but by all means do give us feedback or signal your interest | ||||
for better support. | ||||
r53171 | For compatibility with non-Rust version of Mercurial check the previous "Word of | |||
Caution" section. | ||||
Raphaël Gomès
|
r49364 | No Rust extensions are available for Windows at this time. | ||
Features | ||||
======== | ||||
The following operations are sped up when using Rust: | ||||
Raphaël Gomès
|
r49520 | |||
Raphaël Gomès
|
r49364 | - discovery of differences between repositories (pull/push) | ||
- nodemap (see :hg:`help config.format.use-persistent-nodemap`) | ||||
- all commands using the dirstate (status, commit, diff, add, update, etc.) | ||||
r49523 | - dirstate-v2 (see :hg:`help config.format.use-dirstate-v2`) | |||
Raphaël Gomès
|
r49364 | - iteration over ancestors in a graph | ||
More features are in the works, and improvements on the above listed are still | ||||
in progress. For more experimental work see the "rhg" section. | ||||
Checking for Rust | ||||
================= | ||||
Mads Kiilerich
|
r50053 | You may already have the Rust extensions depending on how you install | ||
Mercurial:: | ||||
Raphaël Gomès
|
r49364 | |||
$ hg debuginstall | grep -i rust | ||||
checking Rust extensions (installed) | ||||
checking module policy (rust+c-allow) | ||||
If those lines don't even exist, you're using an old version of `hg` which does | ||||
not have any Rust extensions yet. | ||||
Installing | ||||
========== | ||||
You will need `cargo` to be in your `$PATH`. See the "MSRV" section for which | ||||
version to use. | ||||
Using pip | ||||
--------- | ||||
Mads Kiilerich
|
r50053 | Users of `pip` can install the Rust extensions with the following command:: | ||
Raphaël Gomès
|
r49364 | |||
r53170 | $ pip install mercurial \ | |||
--global-option \ | ||||
--rust \ | ||||
--no-use-pep517 \ | ||||
--no-binary mercurial | ||||
Raphaël Gomès
|
r49364 | |||
`--no-use-pep517` is here to tell `pip` to preserve backwards compatibility with | ||||
the legacy `setup.py` system. Mercurial has not yet migrated its complex setup | ||||
to the new system, so we still need this to add compiled extensions. | ||||
r53170 | `--no-binary` is there to tell pip to not use the pre-compiled wheels that are | |||
missing rust support. This might take a couple of minutes because you're | ||||
compiling everything. | ||||
Raphaël Gomès
|
r49364 | |||
See the "Checking for Rust" section to see if the install succeeded. | ||||
From your distribution | ||||
---------------------- | ||||
Some distributions are shipping Mercurial with Rust extensions enabled and | ||||
pre-compiled (meaning you won't have to install `cargo`), or allow you to | ||||
specify an install flag. Check with your specific distribution for how to do | ||||
that, or ask their team to add support for hg+Rust! | ||||
From source | ||||
----------- | ||||
Please refer to the `rust/README.rst` file in the Mercurial repository for | ||||
instructions on how to install from source. | ||||
MSRV | ||||
==== | ||||
Georges Racinet
|
r51283 | The minimum supported Rust version is defined in `rust/clippy.toml`. | ||
The project's policy is to keep it at or below the version from Debian testing, | ||||
to make the distributions' job easier. | ||||
Raphaël Gomès
|
r49364 | |||
rhg | ||||
=== | ||||
There exists an experimental pure-Rust version of Mercurial called `rhg` with a | ||||
fallback mechanism for unsupported invocations. It allows for much faster | ||||
execution of certain commands while adding no discernable overhead for the rest. | ||||
The only way of trying it out is by building it from source. Please refer to | ||||
`rust/README.rst` in the Mercurial repository. | ||||
Raphaël Gomès
|
r50461 | See `hg help config.rhg` for configuration options. | ||
Raphaël Gomès
|
r49364 | Contributing | ||
============ | ||||
If you would like to help the Rust endeavor, please refer to `rust/README.rst` | ||||
in the Mercurial repository. | ||||