CVS2HG(1)

NAME
cvs2hg - convert CVS repository to Mercurial

SYNOPSIS
cvs2hg [-a authormap] [-b brachmap] [-f fixup-sql-script] [-s merge-limit-seconds] source destination

DESCRIPTION
cvs2hg is a script to convert a cvs(1) repository to hg(1) using cvs2fossil(1) and hg(1).

source must be a CVS repository (the server side, i.e. the RCS files, not a checkout). cvs2hg will create destination.fossil (the fossil conversion created by cvs2fossil(1)). fossil(1) will create a git(1) fast-import file destination.fossil.export which will be converted into the Mercurial repository destination.hg by hg(1.) hg(1) will also be used to update the author information using an authormap file, if provided.

cvs2hg supports the following flags:

-a authormap
    Pass a hg(1) authormap file for creating proper author information using hg(1) convert. The file should consist of lines of the format:
        login=Full Name <email@address>

-b branchmap
    Pass a hg(1) branchmap file for renaming branches using hg(1) convert. The file should consist of lines of the format:
        old_branch_name new_branch_name

-f fixup-sql-script
    Pass an SQL fixup script for cvs2fossil(1) for its -f flag.

-s merge-limit-seconds
    Pass a merge time limit in seconds to cvs2fossil(1).

EXAMPLES
To convert the NetBSD src repository, if you have developer access, do:

    export REPO=src
    export LOGIN=username
    rsync -aS --delete -e ssh "$LOGIN"@cvs.NetBSD.org::cvsroot/"$REPO" "$REPO"-rsync
    cvs2hg -a authormap -b branchmap -s 300 "$REPO"-rsync/"$REPO" "$REPO"

The conversion output is in src.hg. The intermediate fossil directory is src.fossil and the corresponsing fast-import file src.fossil.export. If you use -a there will be another src.hg.old directory, respectively. You can delete them after the conversion.