Switching from Another Tool to Mercurial

Mercurial is bundled with an extension named convert, which can incrementally import revision history from several other revision control tools. By incremental, I mean that you can convert all of a project’s history to date in one go, then rerun the conversion later to obtain new changes that happened after the initial conversion.

The revision control tools supported by convert are as follows:

  • Subversion

  • CVS

  • Git

  • Darcs

In addition, convert can export changes from Mercurial to Subversion. This makes it possible to try Subversion and Mercurial in parallel before committing to a switchover, without risking the loss of any work.

The convert command is easy to use. Simply point it at the path or URL of the source repository, optionally give it the name of the destination repository, and it will start working. After the initial conversion, just run the same command again to import new changes.

Get Mercurial: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.