views:

260

answers:

4

I trying to recover some old source code (plain text) from a bunch of files that used to be managed with CVS. I have a directory containing all of the source code files in CVS's *,v file format. This looks mostly like the original files, but there are quite a bit of CVS specific header and revision information in there.

Is there a simply way to strip out all the CVS stuff and just keep the latest revision of the file?

A: 

Try to setup CVS client and read your files as local CVS repository.

Andrey Shvydky
A: 

Yes, install a CVS client, set environment variable CVSROOT to point to the root of your repository, and type cvs checkout dir where dir is a top level directory in your repository.

If for some reason you only have individual ,v files, they are in rcs format, so if the rcs program is installed it should be able to get the tip revision out of any ,v file.

DigitalRoss
A: 

Depending on your platform, you might find rcs to work well, as long as you're looking at only a few files at a time. On many Unix/Linux systems, if my memory serves, you could use the co (checkout) command straight from the command line.

Or you could take advantage of the fact that CVS and rcs store the latest version of the file on head near the top of the file, and any other revisions are created by applying diffs internally. Therefore, you can probably strip out the latest version easily using a text editor, and possibly automate it with a perl script. This trick won't work for any other version.

These are options in case there's problems with quick installing a CVS server (if one isn't already installed; they tend to come with Unix-like systems) and checking out.

David Thornley
+3  A: 

You don't even need to use CVS. CVS was just a front end to RCS, and the *.v files are really RCS files. Just check them out. eg, if you have foo,v just execute:

co foo

and it will checkout foo from the ,v file

William Pursell