What is Mercurial?

What is Mercurial?

Mercurial, often referred to by its CLI command ‘hg’ (the chemical symbol for Mercury), is a free, open-source, distributed version control system. Matt Mackall began developing Mercurial in 2005, for use with the Linux Kernel project, using Python as the primary language, as opposed to C.

Around the same time, Git had started development, and although Git was ultimately chosen for use with the Linux Kernel project, Mercurial still attracted a huge fan base for a number of reasons, not least of which being its focus on simplicity, high performance, scalability, and how it handles both plain text, and binary files. In fact, despite being less popular than Git in open source communities, many well-known companies have opted to use Mercurial, such as Mozilla, W3C, Facebook, and OpenOffice.

As Mercurial is a distributed version control system, each developer has a local clone of the entire project repository history, negating the need for a server, or network access in order to create commits. This makes it easy to collaborate with developers while keeping the default branch clean and secure.

Keeping history safe and secure is obviously one of the main focal points of Mercurial as it does not allow you to rewrite repository histories, instead using hg rollback will only undo the last commit. Comparatively, in Git git rebase -interactive allows you to throw caution to the wind, making history a lot less written in stone.

Although on the surface this might appear to make Git a more promising option, having such destructive commands at the core makes it easy for reckless users to make mistakes, and can result in the loss of data. Of course, there are extensions to allow this functionality in Mercurial, but choosing to keep destructive commands out of the core safeguards the code.

Mercurial is also designed with usability and smoothness in mind, making it comparatively simpler to pick up than Git. In terms of commands and features, Mercurial has been noted to more closely resemble the widely used centralized version control system, Subversion. This, in turn, can make it easier for those already familiar with SVN to pick up.

In short, Mercurial bridges the divide between SVN and Git, in a simple, intuitive, and well-documented system. It is designed to keep code histories safe, secure, and free from reckless loss.

Read also:

Seamless software development.

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

Sign up for free
comments powered by Disqus