Mercurial is a
distributed revision control tool for
software developer
Software development is the process of designing and Implementation, implementing a software solution to Computer user satisfaction, satisfy a User (computing), user. The process is more encompassing than Computer programming, programming, wri ...
s. It is supported on
Microsoft Windows
Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
,
Linux
Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
, and other
Unix-like
A Unix-like (sometimes referred to as UN*X, *nix or *NIX) operating system is one that behaves in a manner similar to a Unix system, although not necessarily conforming to or being certified to any version of the Single UNIX Specification. A Uni ...
systems, such as
FreeBSD
FreeBSD is a free-software Unix-like operating system descended from the Berkeley Software Distribution (BSD). The first version was released in 1993 developed from 386BSD, one of the first fully functional and free Unix clones on affordable ...
and
macOS
macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
.
Mercurial's major design goals include high performance and scalability, decentralization, fully distributed collaborative development, robust handling of both
plain text
In computing, plain text is a loose term for data (e.g. file contents) that represent only characters of readable material but not its graphical representation nor other objects ( floating-point numbers, images, etc.). It may also include a lim ...
and
binary file
A binary file is a computer file that is not a text file. The term "binary file" is often used as a term meaning "non-text file". Many binary file formats contain parts that can be interpreted as text; for example, some computer document files ...
s, 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
Subversion () refers to a process by which the values and principles of a system in place are contradicted or reversed in an attempt to sabotage the established social order and its structures of Power (philosophy), power, authority, tradition, h ...
. Mercurial is primarily a
command-line driven program, but
graphical user interface
A graphical user interface, or GUI, is a form of user interface that allows user (computing), users to human–computer interaction, interact with electronic devices through Graphics, graphical icon (computing), icons and visual indicators such ...
extensions are available, e.g.
TortoiseHg, and several
IDEs offer support for version control with Mercurial. All of Mercurial's operations are invoked as arguments to its driver program
hg
(a reference to Hg – the
chemical symbol
Chemical symbols are the abbreviations used in chemistry, mainly for chemical elements; but also for functional groups, chemical compounds, and other entities. Element symbols for chemical elements, also known as atomic symbols, normally consist ...
of the element
mercury).
Olivia Mackall originated Mercurial and served as its lead developer until late 2016. Mercurial is released as
free software
Free software, libre software, libreware sometimes known as freedom-respecting software is computer software distributed open-source license, under terms that allow users to run the software for any purpose as well as to study, change, distribut ...
under the
GPL-2.0-or-later license. It is mainly implemented using the
Python programming language
Python is a high-level, general-purpose programming language. Its design philosophy emphasizes code readability with the use of significant indentation.
Python is dynamically type-checked and garbage-collected. It supports multiple prog ...
, but includes a binary
diff
In computing, the utility diff is a data comparison tool that computes and displays the differences between the contents of files. Unlike edit distance notions used for other purposes, diff is line-oriented rather than character-oriented, but i ...
implementation written in
C.
History
Mackall first announced Mercurial on 19 April 2005.
The impetus for this was the announcement earlier that month by
Bitmover that they were withdrawing the free version of
BitKeeper
BitKeeper is a discontinued software tool for distributed revision control of computer source code. Originally developed as proprietary software by BitMover Inc., a privately held company based in Los Gatos, California, it was released as open-sou ...
because of the development of
SourcePuller.
BitKeeper had been used for the
version control
Version control (also known as revision control, source control, and source code management) is the software engineering practice of controlling, organizing, and tracking different versions in history of computer files; primarily source code t ...
requirements of the
Linux kernel
The Linux kernel is a Free and open-source software, free and open source Unix-like kernel (operating system), kernel that is used in many computer systems worldwide. The kernel was created by Linus Torvalds in 1991 and was soon adopted as the k ...
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 the now well-known
Git
Git () is a distributed version control system that tracks versions of files. It is often used to control source code by programmers who are developing software collaboratively.
Design goals of Git include speed, data integrity, and suppor ...
project was initiated by
Linus Torvalds
Linus Benedict Torvalds ( , ; born 28 December 1969) is a Finnish software engineer who is the creator and lead developer of the Linux kernel. He also created the distributed version control system Git.
He was honored, along with Shinya Yam ...
with similar aims.
The Linux kernel project decided to use
Git
Git () is a distributed version control system that tracks versions of files. It is often used to control source code by programmers who are developing software collaboratively.
Design goals of Git include speed, data integrity, and suppor ...
rather than Mercurial, but Mercurial is now used by many other projects (see
below).
In an answer on the Mercurial mailing list, Olivia Mackall explained how the name "Mercurial" was chosen:
High-profile projects such as the
OpenJDK
OpenJDK (Open Java Development Kit) is a free and open-source implementation of the Java Platform, Standard Edition (Java SE). It is the result of an effort Sun Microsystems began in 2006, four years before the company was acquired by Oracle Corp ...
have used Mercurial in the past, though the OpenJDK no longer does as of Java 16.
Design
Mercurial uses
SHA-1
In cryptography, SHA-1 (Secure Hash Algorithm 1) is a hash function which takes an input and produces a 160-bit (20-byte) hash value known as a message digest – typically rendered as 40 hexadecimal digits. It was designed by the United States ...
hashes to identify revisions. For repository access via a network, Mercurial uses an
HTTP
HTTP (Hypertext Transfer Protocol) is an application layer protocol in the Internet protocol suite model for distributed, collaborative, hypermedia information systems. HTTP is the foundation of data communication for the World Wide Web, wher ...
-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.
Usage
Figure 1 shows some of the most important operations in Mercurial and their relations to Mercurial's concepts.
Adoption
Although Mercurial was not selected to manage the Linux kernel sources, it was adopted by several organizations. Facebook is using the
Rust programming language
Rust is a general-purpose programming language emphasizing performance, type safety, and concurrency. It enforces memory safety, meaning that all references point to valid memory. It does so without a conventional garbage collector; instea ...
to write Mononoke, a Mercurial server specifically designed to support large multi-project repositories.
In 2013, Facebook adopted Mercurial and began work on scaling it to handle their large, unified code repository.
Google also uses Mercurial client as a front-end on their cloud-based 'Piper' monorepo back-end.
Bitbucket
Bitbucket is a Git-based source code repository hosting service owned by Atlassian. Bitbucket offers both commercial plans and free accounts with an unlimited number of private repositories.
Services Bitbucket Cloud
Bitbucket Cloud (pre ...
announced that its web-based version control services would end support for Mercurial in June 2020 (then extended to July 2020), explaining that "less than 1% of new projects use it, and developer surveys indicated that 90% of developers use Git".
Xen used Mercurial for many years, but moved to Git in 2013.
Mozilla
Mozilla is a free software community founded in 1998 by members of Netscape. The Mozilla community uses, develops, publishes and supports Mozilla products, thereby promoting free software and open standards. The community is supported institution ...
used Mercurial for many years, but started moving to end support for Mercurial in 2023.
Mercurial servers and repository management
* Heptapod, a
GitLab
GitLab is a software forge primarily developed by GitLab Inc. It is available as a community edition and a commercial edition.
History
GitLab was created in 2011 by Ukrainian programmer Dmitriy Zaporozhets as a side project written in Rub ...
fork for Mercurial by Octobus
*
Kallithea
Kallithea (Greek language, Greek: Καλλιθέα, meaning "beautiful view") is a suburb in Athens#Athens Urban Area, Athens agglomeration and a municipality in South Athens (regional unit), south Athens regional unit. It is the eighth larges ...
, a
GPLv3
The GNU General Public Licenses (GNU GPL or simply GPL) are a series of widely used free software licenses, or ''copyleft'' licenses, that guarantee end users the freedom to run, study, share, or modify the software. The GPL was the first ...
fork of RhodeCode
* Kiln by
Glitch, Inc.
*
Phabricator by
Phacility
*
RhodeCode by
RhodeCode Inc.
Source code hosting
The following websites provide free source code hosting for Mercurial repositories:
*
Bitbucket
Bitbucket is a Git-based source code repository hosting service owned by Atlassian. Bitbucket offers both commercial plans and free accounts with an unlimited number of private repositories.
Services Bitbucket Cloud
Bitbucket Cloud (pre ...
by
Atlassian
Atlassian Corporation () is an Australia, Australian-United States, American proprietary software company that specializes in collaboration tools designed primarily for software development and project management. Domicile (law), Domiciled in ...
(gone as of July 2020)
* Codebase
*
GNU Savannah by
FSF
* Heptapod
*
OSDN (seems dysfunctional as of 2024-12)
*
Perforce
* Puszcza (a sister site to GNU Savannah, hosted in Ukraine)
*
SourceForge
SourceForge is a web service founded by Geoffrey B. Jeffery, Tim Perdue, and Drew Streib in November 1999. SourceForge provides a centralized software discovery platform, including an online platform for managing and hosting open-source soft ...
SourceHut* TuxFamily
Mercurial website mentions som
other forges
Open source projects using Mercurial
Some projects using the Mercurial distributed RCS:
*
GNU Multi-Precision Library
*
GNU Octave
GNU Octave is a scientific programming language for scientific computing and numerical computation. Octave helps in solving linear and nonlinear problems numerically, and for performing other numerical experiments using a language that is mostly ...
*
LEMON
The lemon (''Citrus'' × ''limon'') is a species of small evergreen tree in the ''Citrus'' genus of the flowering plant family Rutaceae. A true lemon is a hybrid of the citron and the bitter orange. Its origins are uncertain, but some ...
*
LiquidFeedback
*
Orthanc
*
Pidgin
A pidgin , or pidgin language, is a grammatically simplified form of contact language that develops between two or more groups of people that do not have a language in common: typically, its vocabulary and grammar are limited and often drawn f ...
*
RhodeCode
*
Roundup
*
Tryton
*
XEmacs
XEmacs is a graphical- and console-based text editor which runs on almost any Unix-like operating system as well as Microsoft Windows. XEmacs is a fork, based on a version of GNU Emacs from the late 1980s. Any user can download, use, and modify ...
*
Xine
xine is a multimedia playback engine for Unix-like operating systems released under the GNU General Public License. xine is built around a shared library (xine-lib) that supports different frontend player applications. xine uses libraries fr ...
*
eric
The given name Eric, Erich, Erikk, Erik, Erick, Eirik, or Eiríkur is derived from the Old Norse name ''Eiríkr'' (or ''Eríkr'' in Old East Norse due to monophthongization).
The first element, ''ei-'' may be derived from the older Proto-N ...
Open source projects formerly using Mercurial
*
Mozilla
Mozilla is a free software community founded in 1998 by members of Netscape. The Mozilla community uses, develops, publishes and supports Mozilla products, thereby promoting free software and open standards. The community is supported institution ...
2007
-2023
*
Xen ?-2013
*
OpenJDK
OpenJDK (Open Java Development Kit) is a free and open-source implementation of the Java Platform, Standard Edition (Java SE). It is the result of an effort Sun Microsystems began in 2006, four years before the company was acquired by Oracle Corp ...
See also
*
Comparison of version-control software
The following tables describe attributes of notable version control and software configuration management (SCM) systems that can be used to compare and contrast the various systems.
For SCM software not suitable for source code, see Comparis ...
*
Distributed version control
In software development, distributed version control (also known as distributed revision control) is a form of version control in which the complete codebase, including its full history, is mirrored on every developer's computer. Compared to centr ...
*
List of version-control software
Notes
References
External links
*
{{Revision control software
2005 software
Cross-platform free software
Distributed version control systems
Free software programmed in C
Free software programmed in Python
Free version control software
Version control systems