New project hg-setup: utility to help setup Mercurial

PIERRE AUGIER pierre.augier at univ-grenoble-alpes.fr
Tue Dec 17 16:13:47 UTC 2024


Hi, 

I wrote hg-setup (https://foss.heptapod.net/fluiddyn/hg-setup), a tiny Python application to help in setting up Mercurial, in particular writing a reasonable ~/.hgrc and setting up shell completion. It is NOT a Mercurial extension.

The main command is `hg-setup init`, which open a simple Terminal User Interface. `hg-setup init -f` to open it even if you already have a ~/.hgrc.

hg-setup is specially useful to finalize Mercurial installation done with tools like UV or Pixi.

I'd like to stress that these tools are particularly convenient to install Python applications like Mercurial. And in particular Python applications with Python plugins (again like Mercurial)! On Windows, macOS and Linux, one can install UV (https://docs.astral.sh/uv/) or Pixi with only one command (These are Rust CLI.). Then, Mercurial and its extensions can be installed with another command. Users don't even see that these are Python packages. So it seems to me that UV could become a reference tool to install Mercurial, I mean that it could be advertised on Mercurial website and documentation. 

uv tool install mercurial --with hg-git --with hg-evolve 
uvx hg-setup init


I think it makes sense to have hg-setup outside Mercurial core:

- hg-setup can only depend on modern python (I choose >=3.11). With tools like UV and Pixi, no need to support old Python.
- hg-setup can use modern Python packages (like textual and click) so that it easy/faster to make nicer CLI and UI. These are still small dependencies.
- faster development cycle for this very new project.

hg-setup is going to be very useful for my students and colleagues. I hope other Mercurial users can also find it useful.

I think this project and of course the wheels on PyPI can soon make modern Mercurial more accessible to beginners.

A goal could be to become a recognized alternative for versioning (at least for the client) simpler, safer and nicer than Git, which would motivate educational Gitlab instances to switch to Heptapod.

I think it could make sense to launch a doctoral course on versioning based on Mercurial. However, it seems to me that for that we need one important improvement of hg-git: compatibility with topic and evolve (https://foss.heptapod.net/mercurial/hg-git/-/merge_requests/101). It's not possible to say: "modern Mercurial is great but actually, since you have to use Github and you don't have access to a platform compatible with Mercurial (like Heptapod) you need to learn bookmarks and get a much less nice user experience".

Pierre

--
Pierre Augier - CR CNRS                 http://www.legi.grenoble-inp.fr
LEGI (UMR 5519) Laboratoire des Ecoulements Geophysiques et Industriels
BP53, 38041 Grenoble Cedex, France                tel:+33.4.56.52.86.16


More information about the Mercurial mailing list