parsecvs - fast-export the contents of an RCS or CVS repository
parsecvs [-h] [-w 'fuzz'] [-k] [-g] [-v] [-A 'authormap'] [-R 'revmap'] [-V] [-T] [--reposurgeon]
parsecvs tries to group the per-file commits and tags in a RCS file collection or CVS project repository into per-project changeset commits with common metadata, in the style of Subversion and later version-control systems.
The pathnames of RCS files to be analyzed are accepted on standard input. Directories are skipped.
In the default mode, which generates a git-style fast-export stream to standard output:
-
The longest common prefix of the paths is discarded from each path.
-
Files in CVS Attic directories are treated as though the "Attic/" portion of the path were absent.
-
Each patchset in the collection of files becomes a commit.
-
CVS tags become git lightweight tags.
-
The HEAD branch is renamed to 'master'.
-
Other tag and branch names are sanitized to be legal for git; the characters ~^\*? are removed.
-
Since .cvsignore files have a syntax upward-compatible with that of .gitignore files, they’re renamed.
This program does not depend on any of the CVS metadata held outside the individual content files (e.g. under CVSROOT).
- -h
-
Display usage summary.
- -w 'fuzz'
-
Set the timestamp fuzz factor for identifying patch sets in seconds. The default is 300 seconds.
- -k
-
Suppress RCS/CVS keyword expansion.
- -g
-
generate a picture of the commit graph in the DOT markup language used by the graphviz tools, rather than fast-exporting.
- -A 'authormap'
-
Apply an author-map file to the attribution lines. Each line must be of the form
ferd = Ferd J. Foonly <[email protected]> America/Chicago
and will be applied to map the Unix username 'ferd' to the DVCS-style user identity specified after the equals sign. The timezone field (after > and whitespace) is optional and (if present) is used to set the timezone offset to be attached to the date; acceptable formats for the timezone field are anything that can be in the TZ environment variable, including a [+-]hhmm offset. Whitespace around the equals sign is stripped. Lines beginning with a # or not containing an equals sign are silently ignored.
- -R 'revmap'
-
Write a revision map to the specified argument filename. Each line of the revision map consists of three whitespace-separated fields: a filename, an RCS revision number, and the mark of the commit to which that filename-revision pair was assigned. Doesn’t work with -g.
- -v
-
Show verbose progress messages mainly of interest to developers.
- -T
-
Force deterministic dates for regression testing. Each patchset will have a monotonic-increasing attributed date computed from its mark in the output stream - the mark value times the commit time window times two.
- --reposurgeon
-
Emit for each commit a list of the CVS file:revision pairs composing it as a bzr-style commit property named "cvs-revisions". From version 2.12 onward, reposurgeon can interpret these and use them as hints for reference-lifting.
- -V
-
Emit the program version and exit.
Translating RCS/CVS repositories to the generic DVCS model expressed by import streams is not merely difficult and messy, there are weird RCS/CVS cases that cannot be correctly translated at all. parsecvs will try to warn you about these cases rather than silently producing broken or incomplete translations.
RCS/CVS tags are per-file, not per revision. If developers are not careful in their use of tagging, it can be impossible to associate a tag with any of the changesets that parsecvs resolves. When this happens, parsecvs will issue the warning "Unmatched tag" followed by the tag name.
CVS-NT and versions of GNU CVS after 1.12 (2004) added a changeset commit-id to file metadata. Older sections of CVS history without these are vulnerable to various problems caused by clock skew between clients; this used to be relatively common for multiple reasons, including less pervasive use of NTP clock synchronization. parsecvs will warn you ("Commits before this date lack commitids") when it sees such a section in your history. When it does, these caveats apply:
-
If timestamps of commits in the CVS repository were not stable enough to be used for ordering commits, changes may be reported in the wrong order.
-
If the timestamp order of different files crosses the revision order within the commit-matching time window, the order of commits reported may be wrong.
These problems cannot be fixed in parsecvs; they are inherent to CVS.
There was an 0.1 version of this program that created a git repository directly rather than emitting a fast-import stream. It broke when the git library interface changed.
Report bugs to Eric S. Raymond <[email protected]>. The analysis stage was mostly by Keith Packard, ESR dusted it off and made it generate a fast- import stream. The project page is at http://catb.org/~esr/parsecvs