[PATCH 0 of 3] convert: Built-in cvsps for hg cvs import (8).

Frank Kingswood frank at kingswood-consulting.co.uk
Sun Jun 15 11:18:59 CDT 2008


convert: Built-in cvsps for hg cvs import.

This patch adds a built-in cvsps replacement.
To use this, set these options in .hgrc.

        [convert]
        cvsps = builtin
        cvsps.fuzz = cvs changeset datestamp fuzz
        cvsps.mergeto = some regular expression
        cvsps.mergefrom = some regular expression

The built-in cvsps uses cvs rlog on the repository (it does not do
direct cvs server calls, it runs the cvs executable), sorts the commit
log messages, and merges commits with identical messages, author and
branch name and a date within the 60-seconds (default) fuzz window.

A log cache file is written to ~/.hg.cvsps/, which is used to avoid
re-reading all of the CVS log when the conversion is run again.

This builtin cvsps code has been found to work succesfully in cases
where the traditional external cvsps program generates incorrect
changesets.

The builtin cvsps code can merge CVS branches based on magic tags in
the CVS log message. When a log message matches the cvsps.mergefrom
regular expression, then cvsps will set a second parent for a changeset
to indicate a merge from the named branch.
When a log message matches the cvsps.mergeto regular expression then
cvsps will insert a dummy changeset (with no members, so no changes)
merging the branch into the named branch (which must exist).
The cvsps.mergefrom pattern defaults to {{mergefrombranch ([-\w]+)}},
and the cvsps.mergeto pattern defaults to {{mergetobranch ([-\w]+)}}.

For convenience, a wrapper is provided so that thethe cvsps.py script 
can also be run as a standalone replacement for cvsps, as long as the
mercurial modules are in the PYTHONPATH. When run standalone, cvsps
accepts these options -b -p -r --root -u -v -x and -z from the C
implementation.

This eigth version fixes some more coding style violations, fixes
a bug in conversions of an entire CVS repository, and adds some debug
and note output.


More information about the Mercurial-devel mailing list