What's new in Mercurial (HG) 4.2?

What's new in Mercurial (HG) 4.2?

The newest version of Mercurial (HG), 4.2, was released on 3rd of May 2017. A new major release of Mercurial is done four times in a year with a fixed schedule. This blog post introduces the most important and noteworthy changes, as a TLDR to the original release notes. If you want to host Mercurial (HG) repositories in the cloud or behind your firewall, Deveo offers Mercurial repository hosting.


For HG commands that generate long output, there has been a specific Pager extension available that allowed to configure an external pager, such as less or more in .hgrc file. In Mercurial 4.2 the Pager has been moved to the core and is turned on by default for any command that can produce long output.

The existing pager extension itself is deprecated but will continue to work and overrides the core pager if configured.


Mercurial 4.2 turns colors on by default. The color extension is moved to the core and the existing color extension is deprecated. If you don't like colors for one reason or another, you can still configure ui.color=never in your .hgrc file.

Show extension

Mercurial 4.2 adds hg show command, that provides a lot of information about your repository in an ergonomic way. The output is meant for human consumption, rather than scripting. With hg show it's easy to find commonly-accessed repository data and views of that data. hg show could be considered as an equivalent for similar command in Subversion svn info. The output of hg show gives much more information, though.

Other changes

A rather small, but helpful improvement in Mercurial 4.2 is the ability of hg status command to be able to display paths relative to the working directory. Switching between showing absolute or relative paths needs to be configured by adding commands.status.relative=1 in .hgrc. A sample output of relative paths disabled and enabled for the hg status command is shown below:

hg status with relative paths disabled:

ilmarikontulainen@MacBook-Air-2 hg $ hg status  
M doc/check-seclevel.py  
M mercurial/fileset.py  
R mercurial/tagmerge.py  

hg status with relative paths enabled:

ilmarikontulainen@MacBook-Air-2 hg $ cd doc/  
ilmarikontulainen@MacBook-Air-2 doc $ hg status  
M check-seclevel.py  
M ../mercurial/fileset.py  
R ../mercurial/tagmerge.py  


Mercurial is taking small steps moving towards more user-friendly out-of-the-box setup, with colors and pager functionality turned on by default. Other than that, the release doesn't bring much new. For the full list of changes in Mercurial 4.2, check the official release notes. If you would like to manage Mercurial repositories behind your firewall, install Deveo Mercurial server for free.

Seamless software development.

Code management and collaboration platform with Git, Subversion, and Mercurial.

Sign up for free
comments powered by Disqus