Recovering files from archive of CVS *,v files

烈酒焚心 提交于 2019-11-29 14:05:56

问题


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?


回答1:


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.




回答2:


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




回答3:


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



回答4:


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




回答5:


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.



来源:https://stackoverflow.com/questions/2267966/recovering-files-from-archive-of-cvs-v-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!