See RepositoryConversion for other conversion tools.

Tailor is a tool that supports conversion between a variety of systems. It's available at http://www.darcs.net/DarcsWiki/Tailor.

Example Tailor conversion from CVS

This is tested with Mercurial 0.7 and Tailor 0.9.18

 mkdir -p /path/to/hg/repo
 cd /path/to/hg/repo
 tailor -v --source-kind cvs --target-kind hg --repository $REP --module MODULENAME -r INITIAL > MODULENAME.tailor
 vi MODULENAME.tailor

Now you will at least need to change subdir from . to MODULENAME, and remove /MODULENAME from root-directory in the MODULENAME.tailor file. You will probably also want to add the line:

 patch-name-format = %(revision)s

at the end of the "project" section to get your cvs checkin comments in the patch summaries. Type man tailor and search for patch-name-format to learn more about this. When done editing the config file type:

 tailor --configfile MODULENAME.tailor

When this is done, you should have a working Mercurial repository that matches the trunk of the CVS archive you have been using. The --repository option gets passed to CVS via the -d option, so anything that works for $CVSROOT will for for --repository.

Be aware that the last stage of this script will take a long time to run. Also, local access to the CVS repository instead of remote access may make it significantly faster.

Things to know:

Tailor config files

A very convenient way to use Tailor is through ini style config files. An example file like the following could be used to convert from a cvs repo to a hg one:

[DEFAULT]
patch-name-format = %(revision)s
verbose = True
encoding = iso-8859-15

[mutt_hg]
root-directory = /home/brendan/hg/mutt
source = cvs:source
target = hg:target

[cvs:source]
module = mutt
repository = :pserver:anonymous@myproject.server.net:/cvsroot/mutt/cvs

[hg:target]
encoding = utf-8