hg-setup can be used to setup Mercurial. The main command provided by this package,
hg-setup init
launches a simple Terminal User Interface (TUI) to initialize a
reasonable user configuration file and shell completion for bash and zsh.
With UV, one can run it without installation with:
uvx hg-setup init
Mercurial is a Python application using C and Rust extensions. It is extendable with Mercurial extensions and two Python packages provide very useful Mercurial extensions that most users should use : hg-git (Mercurial extension hggit) and hg-evolve (Mercurial extensions topic and evolve).
These things are packaged in 3 PyPI packages (associated with their equivalent conda-forge packages): mercurial, hg-git, hg-evolve. Moreover, to use Mercurial extensions, one has to write few lines in a configuration file (~/.hgrc).
Mercurial with hg-git and hg-evolve is great but it is a bit difficult to setup for beginners. hg-setup is there to help people to start with Mercurial and finalize its installation.
Here, we give commands to install in two isolated environment on one side Mercurial and its more useful extensions (hg-git and hg-evolve) and on the other side hg-setup.
- With pipx
pipx install mercurial
pipx inject mercurial hg-git hg-evolve
pipx install hg-setup
- With UV
uv tool install mercurial --with hg-git --with hg-evolve
uv tool install hg-setup
conda activate base
pip install conda-app
conda-app install mercurial
conda-app install hg-setup
- With Pixi
pixi global install mercurial-app
# or (equivalent)
pixi global install mercurial --with hg-git --with hg-evolve
# and then
pixi global install hg-setup
pipx install hg-setup@hg+https://foss.heptapod.net/fluiddyn/hg-setup
For development installation, see the file CONTRIBUTING.md.
The ~/.hgrc
file and shell completion for bash and zsh can be initialized with a simple
Terminal User Interface (TUI):
hg-setup init
We can also avoid the TUI with
hg-setup init --name "Alice Lastname" --email alice.lastname@proton.me --auto
The shell completion for bash and zsh can be initialized with:
hg-setup init-shell-completion bash
hg-setup init-shell-completion zsh