|Initial release||19 April 2005|
3.9.1 / 1 September 2016
|Written in||Python and C|
|Operating system||Unix-like, MS Windows, Mac OS X|
|License||GNU GPL v2+|
Mercurial, a cross-platform, distributed revision-control tool for software developers, is mainly implemented using the Python programming language, but includes a binary diff implementation written in C. It is supported on MS Windows and Unix-like systems, such as FreeBSD, Mac OS X and Linux. Mercurial is primarily a command-line driven program, but graphical user interface extensions are available. All of Mercurial's operations are invoked as arguments to its driver program
hg (a reference to Hg - the chemical symbol of the element mercury).
Mercurial's major design goals include high performance and scalability, decentralized, fully distributed collaborative development, robust handling of both plain text and binary files, and advanced branching and merging capabilities, while remaining conceptually simple. It includes an integrated web-interface. Mercurial has also taken steps to ease the transition for users of other version control systems, particularly Subversion.
BitKeeper had been used for the version control requirements of the Linux kernel project. Mackall decided to write a distributed version control system as a replacement for use with the Linux kernel. This project started a few days after another project called Git, initiated by Linus Torvalds with similar aims.
The Linux kernel project decided to use Git rather than Mercurial, but Mercurial is now used by many other projects (see below). "Git vs. Mercurial" has become one of the holy wars of hacker culture.
In an answer on the Mercurial mailing list, Matt Mackall explained how the name "Mercurial" was chosen:
Shortly before the first release, I read an article about the ongoing Bitkeeper debacle that described Larry McVoy as mercurial (in the sense of 'fickle'). Given the multiple meanings, the convenient abbreviation, and the good fit with my pre-existing naming scheme (see my email address), it clicked instantly. Mercurial is thus named in Larry's honor. I do not know if the same is true of Git.
In 2013, Facebook adopted Mercurial and began work on scaling it to handle their large, unified code repository.
Mercurial uses SHA-1 hashes to identify revisions. For repository access via a network, Mercurial uses an HTTP-based protocol that seeks to reduce round-trip requests, new connections and data transferred. Mercurial can also work over SSH where the protocol is very similar to the HTTP-based protocol. By default it uses a 3-way merge before calling external merge tools.
Figure 1 shows some of the most important operations in Mercurial and their relations to Mercurial's concepts.
Source code hosting
The following websites provide free source code hosting for Mercurial repositories:
- Bitbucket by Atlassian
- CodePlex by Microsoft
- JavaForge (with pull requests to control source code contribution)
- Project Kenai by Oracle
- GNU Savannah by FSF
- Alioth by Debian
- Kiln by Fog Creek Software
Open source projects using Mercurial
Some projects using the Mercurial distributed RCS:
- Mackall, Matt (2005-04-20). "Mercurial v0.1 – a minimal scalable distributed SCM". Linux kernel (Mailing list).
- "What's new", Mercurial (wiki) (3.9.1 ed.), mercurial-scm.org.
- Mackall, Matthew ‘Matt’ (2006), "Towards a Better SCM: Revlog and Mercurial" (PDF), Linux Symposium Proceedings (PDF), Ottawa: Mercurial-scm.org.
- "Relicensing", Mercurial (wiki), Mercurial-scm.org.
- Mackall, Matt (2005-04-29). "Re: Mercurial 0.4b vs git patchbomb benchmark". Linux kernel (Mailing list).
- "Managing source code with Mercurial".
Mercurial and Git fans are also happy to discuss the learning curve, merits, and usability of each VCS system's command set. Space prevents that discussion here, but a web search on that topic will provide lots of interesting reading material.
- Mackall, Matt (2012-02-15). "Why did Matt choose the name Mercurial?". Mercurial (Mailing list). Retrieved 7 June 2016.
- Goode, Durham; Agarwal, Siddharth. "Scaling Mercurial at Facebook". Facebook Code. Facebook. Retrieved 13 October 2015.
- "Scaling Mercurial at Facebook".
- "CodePlex now supporting native Mercurial". CodePlex (Weblog). Microsoft. 2010-01-22.
- "Git, Mercurial & Subversion hosting". Features. Codebase HQ. 2013-03-04.
- "Hosting", Mercurial (wiki), Mercurial-scm.org.
- "Some projects that use Mercurial", Mercurial (wiki), Mercurial-scm.org.
- "Source", Adblock+.
- "Source code repositories migrated from Subversion to Mercurial". Coin3D (news). 2010-02-27.
- "Mercurial Work Flow" (wiki). Illumos. 2011-03-13.
- Reed, J Paul (2007-04-12). "Version Control System Shootout Redux Redux".
- "Switch to hg.netbeans.org completed". Net beans. January 2008.
- "Mercurial". Developers. OGRE – Open Source 3D Graphics Engine. 2010-04-04.
- James Gosling (October 2006). Open Sourcing Sun's Java Platform Implementations, Part 1. Interview with Robert Eckstein. Sun. Archived from the original on 1 March 2009.
- "Source Repositories". OpenIndiana. 2011-03-13.
- Official website
- O'Sullivan, Bryan (2009), Mercurial: The Definitive Guide (book), O'Reilly, freely available online
- "Mercurial: an alternative to git", LWN
- An example-based Mercurial tutorial (PDF), SE: Jemander covering both basic and advanced use
- "Mercurial", TechTalk (video), Google
- "Subversion or CVS, Bazaar or Mercurial? Four open source version control systems compared", Java World, Sep 2007
- Spolsky, Joel, Mercurial tutorial
- Mackall, Matt, "FLOSS Podcast", This week in Tech
- List of projects using Mercurial from the Mercurial wiki
- Mercurial for git developers