Jump to content

Mercurial

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by KevinBullock (talk | contribs) at 14:03, 13 October 2015. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Mercurial
Developer(s)Matt Mackall
Initial release19 April 2005; 19 years ago (2005-04-19)[1]
Stable release
3.5.2[2] / 1 October 2015; 9 years ago (2015-10-01)
Repository
Written inPython and C
Operating systemUnix-like, MS Windows, Mac OS X
TypeRevision control
LicenseGNU GPL v2+
Websitewww.mercurial-scm.org

Mercurial is a cross-platform, distributed revision control tool for software developers. It 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 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 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.[3] It includes an integrated web interface. Mercurial has also taken steps to ease the transition for users of other version control systems, particularly Subversion.

The creator and lead developer of Mercurial is Matt Mackall. Mercurial is released as free software under the terms of the GNU GPL v2 (or any later version[4]).

Technical information

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.

History

Mackall first announced Mercurial on 19 April 2005.[1] The impetus for this was the announcement earlier that month by Bitmover that they were withdrawing the free version of BitKeeper.

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.[5]

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.[6]

In an answer on the Mercurial mailing list, Matt Mackall explained how the name "Mercurial" was chosen:[7]

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.

Usage

Figure 1 shows some of the most important operations in Mercurial and their relations to Mercurial's concepts.

Figure 1: Some important operations of Mercurial and their relations.
Screenshot of hgk in action
Screenshot of TortoiseHg client history
  • GUI interfaces for Mercurial include:
    TortoiseHg
    TortoiseHg is a cross-platform GUI for Mercurial. Most Mercurial operations can be invoked from the graphical interface. It can be used stand-alone on Windows, Mac OS X, or Linux.[8] It can also be integrated with Windows Explorer[9] and GNOME Nautilus.[10] On Windows, the TortoiseHg installer bundles Mercurial and Python, making it a complete environment.
    MacHg
    MacHg is a free and fast multithreaded front end for Mac OS X 10.6 and later.[11]
    SourceTree
    A freeware Mac OS X and Windows GUI client developed by Atlassian that works with both Mercurial and Git.[12]
    Hgk
    This was the original log viewer for Mercurial. It is implemented as a Mercurial extension with a tcl/tk frontend. It was originally based on a similar tool for Git called gitk. This viewer is now considered an unloved feature.[13] Recommended alternatives are hgview[14] or TortoiseHg.
    Murky
    A Mac OS X GUI in Objective-C 2.0, runs on Mac OS X 10.5 and later.[15]
    MacMercurial
    A Mac OS X GUI "not intended to completely replace command line use of Mercurial, only to ease the most common Mercurial operations," for Mac OS X 10.4 or later.[16]
    EasyMercurial
    A simple user interface for the Mercurial distributed version control system. It's free, open source, and cross-platform.[17]
    hgtui
    A free TUI client for Linux and Windows (using cygwin).[18]
  • Related tools for merging include (h)gct (Qt) and Meld.[19]
  • The convert extension allows import from CVS, Darcs, Git, GNU Arch, Monotone, Perforce, Bazaar and Subversion repositories.
  • Microsoft Visual Studio supports Mercurial with the VisualHG[20] and HgSccPackage[21] plugins.
  • NetBeans supports Mercurial from Version 6.
  • Eclipse supports Mercurial with the MercurialEclipse[22] plugin.
  • GNU Emacs has support for Mercurial in its VC extension.

Adoption

Although Mercurial was not selected to manage the Linux kernel sources, it has been adopted by several organizations, including Facebook,[23] the W3C, and Mozilla.

Source code hosting

The following websites provide free source code hosting for Mercurial repositories:

Open source projects using Mercurial

Some projects using the Mercurial distributed RCS:[27]

See also

References

  1. ^ a b Mackall, Matt (20 April 2005). "Mercurial v0.1 – a minimal scalable distributed SCM". Linux kernel (Mailing list). {{cite mailing list}}: Unknown parameter |mailinglist= ignored (|mailing-list= suggested) (help)
  2. ^ "What's new", Mercurial (wiki) (3.5.2 ed.), Selenic.
  3. ^ Mackall, Matthew ‘Matt’ (2006), "Towards a Better SCM: Revlog and Mercurial" (PDF), Linux Symposium Proceedings, Ottawa: Selenic {{citation}}: |format= requires |url= (help).
  4. ^ "Relicensing", Mercurial (wiki), Selenic.
  5. ^ Mackall, Matt (29 April 2005). "Re: Mercurial 0.4b vs git patchbomb benchmark". Linux kernel (Mailing list). {{cite mailing list}}: Unknown parameter |mailinglist= ignored (|mailing-list= suggested) (help)
  6. ^ "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.
  7. ^ Mackall, Matt (15 February 2012). "Why did Matt choose the name Mercurial?". Mercurial (Mailing list). Retrieved 8 March 2012. {{cite mailing list}}: Unknown parameter |mailinglist= ignored (|mailing-list= suggested) (help)
  8. ^ "Introduction". TortoiseHg Documentation. Retrieved 23 April 2014.
  9. ^ "Windows Explorer Integration". TortoiseHg Documentation. Retrieved 23 April 2014.
  10. ^ "GNOME desktop integration". TortoiseHg Documentation. Retrieved 23 April 2014.
  11. ^ http://jasonfharris.com/machg/
  12. ^ http://www.sourcetreeapp.com/
  13. ^ "Hgk Extension". Mercurial Wiki. Retrieved 23 April 2014.
  14. ^ http://www.logilab.org/project/hgview
  15. ^ http://bitbucket.org/snej/murky/wiki/Home
  16. ^ http://www.jwwalker.com/pages/macmerc.html
  17. ^ http://easyhg.org/
  18. ^ https://code.google.com/p/hgtui/
  19. ^ http://meld.sourceforge.net/
  20. ^ http://visualhg.codeplex.com/
  21. ^ http://bitbucket.org/zzsergant/hgsccpackage/
  22. ^ http://www.javaforge.com/project/HGE
  23. ^ "Scaling Mercurial at Facebook".
  24. ^ "CodePlex now supporting native Mercurial". CodePlex (Weblog). Microsoft. 22 January 2010.
  25. ^ "Git, Mercurial & Subversion hosting". Features. Codebase HQ. 4 March 2013.
  26. ^ "Hosting", Mercurial (wiki), Selenic.
  27. ^ "Some projects that use Mercurial", Mercurial (wiki), Selenic.
  28. ^ "Source", Adblock+.
  29. ^ "Source code repositories migrated from Subversion to Mercurial". Coin3D (news). 27 February 2010.
  30. ^ Sirainen, Timo (19 May 2007). "CVS to Mercurial switch". news (Mailing list). Dovecot. {{cite mailing list}}: Unknown parameter |mailinglist= ignored (|mailing-list= suggested) (help)
  31. ^ "Mercurial Work Flow" (wiki). Illumos. 13 March 2011.
  32. ^ Reed, J Paul (12 April 2007). "Version Control System Shootout Redux Redux".
  33. ^ "Switch to hg.netbeans.org completed". Net beans. January 2008.
  34. ^ "Mercurial". Developers. OGRE – Open Source 3D Graphics Engine. 4 April 2010.
  35. ^ James Gosling (October 2006). "Open Sourcing Sun's Java Platform Implementations, Part 1" (Interview). Interviewed by Robert Eckstein. Sun.
  36. ^ "Source Repositories". OpenIndiana. 13 March 2011.