R – Join two versions of history in CVS (or RCS)


I am looking for a way to join two revision histories for a single file.

One of our projects was tracked via RCS. Now, this project lives in CVS. It was initially committed as a new project. As a result, the CVS history does not show the older revisions that were tracked via RCS.

For example, suppose file foo.c was revised 10 times in RCS, then 2 times in CVS. RCS has versions 1.1 through 1.10, and CVS has versions 1.1, 1.2, and 1.3. RCS version 1.10 and CVS version 1.1 are identical.

I am trying to create a combined history such that foo.c shows 12 versions, 1.1 through 1.12. Since CVS stores revisions in the same file format as RCS, it should be a simple matter of beginning with the existing RCS file, then checking in the new changes with the "ci" command (preserving the timestamps, the userids, and commit messages). Any CVS tags would also need to be preserved. This new RCS file would then have the full history, which could then be added to the CVS repository, replacing the old version.

Assume that there are no branches in this codebase. Just straight line development.

Does such a utility program already exist?

Best Solution

I've just written a Python library, EditRCS (PyPi), to manipulate RCS files. The example script rcs_join will join the first revision of one RCS file to the head of another and update the branch and tag revisions.

Hopefully that does what you want (although it's probably too late now!)