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