从 CVS *,v 文件的存档中恢复文件
我试图从一堆过去用 CVS 管理的文件中恢复一些旧的源代码(纯文本)。我有一个目录,其中包含 CVS 的 *,v 文件格式的所有源代码文件。这看起来大部分像原始文件,但其中有相当多的 CVS 特定标头和修订信息。
有没有一种简单的方法可以删除所有 CVS 内容并只保留文件的最新版本?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
您甚至不需要使用
cvs
。cvs
只是rcs
的前端,而*.v
文件实际上是rcs
文件。只需检查一下即可。例如,如果您有foo,v
只需执行:它就会从
*,v
文件中检出 fooYou don't even need to use
cvs
.cvs
was just a front end torcs
, and the*.v
files are reallyrcs
files. Just check them out. eg, if you havefoo,v
just execute:and it will checkout foo from the
*,v
file是的,安装 CVS 客户端,将环境变量 CVSROOT 设置为指向存储库的根目录,然后输入
cvs checkout dir
,其中dir
是存储库中的顶级目录。如果由于某种原因您只有单独的
,v
文件,它们采用rcs
格式,因此如果安装了rcs
程序,它应该能够从任何,v
文件中获取提示修订版。Yes, install a CVS client, set environment variable CVSROOT to point to the root of your repository, and type
cvs checkout dir
wheredir
is a top level directory in your repository.If for some reason you only have individual
,v
files, they are inrcs
format, so if thercs
program is installed it should be able to get the tip revision out of any,v
file.最新的 Windows 二进制文件可以在这里找到:
例如:
将您的存储库文件放置在此处:c:\cvs
(如 c:\cvs\PROJECT
创建 c:\cvs\CVSROOT
创建 c:\work
在这里保存 cvs.exe
运行:
Latest windows binary can find here:
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 客户端并将文件读取为本地 CVS 存储库。
Try to setup CVS client and read your files as local CVS repository.
根据您的平台,您可能会发现 rcs 可以很好地工作,只要您一次只查看几个文件。在许多 Unix/Linux 系统上,如果我没记错的话,您可以直接从命令行使用 co (checkout) 命令。
或者,您可以利用 CVS 和 rcs 将文件的最新版本存储在文件顶部附近的头部,并且任何其他修订都是通过在内部应用差异来创建的。因此,您可以使用文本编辑器轻松删除最新版本,并可能使用 perl 脚本将其自动化。此技巧不适用于任何其他版本。
这些选项是为了防止快速安装 CVS 服务器(如果尚未安装;它们通常带有类 Unix 系统)和签出时出现问题。
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.
当有人签入、更新文件以及访问目录/文件时,通常会发生这种情况。
这对我有用-
只需关闭终端并打开一个新的 one.foo,v 文件就会消失,并会显示正确的文件。
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.