VogonPoet
VogonPoet

Reputation: 283

Recovering files from archive of CVS *,v files

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?

Upvotes: 11

Views: 11144

Answers (6)

William Pursell
William Pursell

Reputation: 212248

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

Upvotes: 19

khan
khan

Reputation: 21

This normally happens when someone makes check-ins ,updates files and u r accessing the directories/files.

This worked for me- Simply close the terminal and open a new one.foo,v files will disappear and proper files would be shown.

Upvotes: 0

petyuska
petyuska

Reputation: 61

Latest windows binary can find here:

https://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-woe/

For example: Place your reposity files here: c:\cvs (like c:\cvs\PROJECT create c:\cvs\CVSROOT

create c:\work save cvs.exe here

run:

cvs -d c:\cvs checkout PROJECT

Upvotes: 6

David Thornley
David Thornley

Reputation: 57036

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.

Upvotes: 0

DigitalRoss
DigitalRoss

Reputation: 146053

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.

Upvotes: 7

Andrii Shvydkyi
Andrii Shvydkyi

Reputation: 2286

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

Upvotes: 0

Related Questions