comparison README.rst @ 6920:df546ef8d75f mercurial-5.0

test-compat: merge mercurial-5.1 into mercurial-5.0
author Anton Shestakov <av6@dwimlabs.net>
date Fri, 25 Oct 2024 18:11:50 +0400
parents 9c70bdc92cdb
children
comparison
equal deleted inserted replaced
6815:cde3f4bc3075 6920:df546ef8d75f
24 * provides an ``hg evolve`` command to deal with such troubles, 24 * provides an ``hg evolve`` command to deal with such troubles,
25 25
26 * improves performance of obsolescence marker exchange and discovery during 26 * improves performance of obsolescence marker exchange and discovery during
27 push and pull. 27 push and pull.
28 28
29 .. _`changeset evolution`: https://www.mercurial-scm.org/wiki/ChangesetEvolution 29 .. _`changeset evolution`: https://wiki.mercurial-scm.org/ChangesetEvolution
30 30
31 Documentation 31 Documentation
32 ------------- 32 -------------
33 33
34 We recommend reading the documentation first. An online version is available 34 We recommend reading the documentation first. An online version is available
46 46
47 You can install the latest released version using pip:: 47 You can install the latest released version using pip::
48 48
49 $ pip install --user hg-evolve 49 $ pip install --user hg-evolve
50 50
51 Then enable it in your hgrc:: 51 Note: some distributions have adopted PEP 668 and made using ``pip install
52 --user`` more difficult than it should be. One of the cleanest ways around this
53 issue is to install both Mercurial and this extension in a separate virtual
54 environment. If you don't want to manage the virtual environment manually, you
55 can use Pipx.
56
57 Using Pipx
58 ----------
59
60 Its documentation explains that "pipx is made specifically for application
61 installation", and the idea is that for every application it can create and
62 maintain a separate virtual environment and make all executables available on a
63 single path (e.g. ~/.local/bin/ on Linux, check ``pipx ensurepath``).
64
65 To create a virtual environment for hg and install evolve::
66
67 $ pipx install mercurial
68 $ pipx inject mercurial hg-evolve
69 # or pipx runpip mercurial install hg-evolve
70
71 Note: it's recommended to use ``inject`` command to install evolve, but
72 sometimes ``runpip`` could be used. On some setups ``inject`` might require
73 specifying the full path to the extension in the configuration file, while
74 ``runpip`` might not.
75
76 Using Your Package Manager
77 --------------------------
78
79 Sometimes your distribution's package manager might have the newest (or recent
80 enough) version of the extension. For example, both `Debian`_ and `Ubuntu`_
81 currently have a package called ``mercurial-evolve``. Similarly, other
82 distributions might have it packaged, possibly under a slightly different name.
83 Try searching your package manager's database or see `this Repology page`_.
84
85 .. _`Debian`: https://packages.debian.org/search?keywords=mercurial-evolve&searchon=names&exact=1&suite=all&section=all
86 .. _`Ubuntu`: https://packages.ubuntu.com/search?keywords=mercurial-evolve&searchon=names&exact=1&suite=all&section=all
87 .. _`this Repology page`: https://repology.org/project/mercurial-evolve/related
88
89 From Source
90 -----------
91
92 To obtain a local version from source::
93
94 $ hg clone https://repo.mercurial-scm.org/evolve
95
96 There's no need to compile anything or run ``make``.
97
98 This method keeps the extension in its own repo, and you can use it by
99 specifying the full path to the ``hgext3rd/evolve/``.
100
101 Alternatively, you can install it::
102
103 $ cd evolve
104 # optionally `hg update <target revision>`
105 $ pip install --user .
106
107 This should avoid the need to specify the full path to the extension.
108
109 Enabling the Extension
110 ----------------------
111
112 After installing the extension, you need to enable it before you can use it.
113
114 To do that, edit your hgrc::
52 115
53 $ hg config --edit # add these two lines: 116 $ hg config --edit # add these two lines:
54 [extensions] 117 [extensions]
55 evolve = 118 evolve =
56 119
57 From Source 120 If you didn't install the extension or Mercurial can't find it on one of the
58 ----------- 121 default paths, you need to specify the full path to ``hgext3rd/evolve/``::
59
60 To install a local version from source::
61
62 $ hg clone https://www.mercurial-scm.org/repo/evolve/
63 $ cd evolve
64 # optionally `hg update <target revision>`
65 $ pip install --user .
66
67 Then enable it in your hgrc::
68
69 $ hg config --edit # add these two lines:
70 [extensions]
71 evolve =
72
73 It's also possible to use evolve without installing it, in which case you will
74 need to provide the full path to ``hgext3rd/evolve/``, for example::
75 122
76 [extensions] 123 [extensions]
77 evolve = ~/evolve/hgext3rd/evolve 124 evolve = ~/evolve/hgext3rd/evolve
78 125
126 Similarly, if you want to enable topic extension, do this::
127
128 $ hg config --edit
129 [extensions]
130 topic =
131 # or
132 topic = ~/evolve/hgext3rd/topic
133
79 Pitfalls 134 Pitfalls
80 -------- 135 --------
81 136
82 If you get ``"failed to import extension evolve: No module named 'evolve'"`` 137 If you get ``"failed to import extension evolve: No module named 'evolve'"``
83 error, there are a couple of things to check: 138 error, there are a couple of things to check:
84 139
85 * make sure you gave pip the correct package name (it's hg-evolve), 140 * make sure you gave pip/pipx the correct package name (it's ``hg-evolve``),
86 141
87 * make sure evolve is installed for the same version of Python that you use for 142 * make sure evolve is installed for the same version of Python that you use for
88 running Mercurial (``hg debuginstall | grep Python``). 143 running Mercurial (``hg debuginstall | grep Python``),
144
145 * try specifying the full path to the ``hgext3rd/evolve/`` directory.
89 146
90 Extension Purpose 147 Extension Purpose
91 ================= 148 =================
92 149
93 The goal of this extension is to provide an appropriate place for code and 150 The goal of this extension is to provide an appropriate place for code and
108 ================ 165 ================
109 166
110 Mercurial announced official `support for Python 3`_ starting with its 5.2 167 Mercurial announced official `support for Python 3`_ starting with its 5.2
111 release. Since 9.3.0, evolve has official support for Python 3.6+. 168 release. Since 9.3.0, evolve has official support for Python 3.6+.
112 169
113 .. _`support for Python 3`: https://www.mercurial-scm.org/wiki/Python3 170 .. _`support for Python 3`: https://wiki.mercurial-scm.org/Python3
114 171
115 Python 2 Support 172 Python 2 Support
116 ================ 173 ================
117 174
118 Python 2 is supported by evolve. However, Mercurial 6.2 release dropped support 175 Python 2 is supported by evolve. However, Mercurial 6.2 release dropped support
144 201
145 $ hg email --to mercurial-devel@mercurial-scm.org --flag evolve-ext --rev '<your patches>' 202 $ hg email --to mercurial-devel@mercurial-scm.org --flag evolve-ext --rev '<your patches>'
146 203
147 For guidelines on the patch description, see the `official Mercurial guideline`_. 204 For guidelines on the patch description, see the `official Mercurial guideline`_.
148 205
149 .. _`official Mercurial guideline`: https://mercurial-scm.org/wiki/ContributingChanges#Patch_descriptions 206 .. _`official Mercurial guideline`: https://wiki.mercurial-scm.org/ContributingChanges#Patch_descriptions
150 207
151 Please don't forget to update and run the tests when you fix a bug or add a 208 Please don't forget to update and run the tests when you fix a bug or add a
152 feature. To run the tests, you need a working copy of Mercurial, say in 209 feature. To run the tests, you need a working copy of Mercurial, say in
153 $HGSRC:: 210 $HGSRC::
154 211