从 CVS *,v 文件的存档中恢复文件

发布于 2024-08-22 08:31:54 字数 157 浏览 3 评论 0原文

我试图从一堆过去用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

思念绕指尖 2024-08-29 08:31:54

您甚至不需要使用cvscvs 只是 rcs 的前端,而 *.v 文件实际上是 rcs 文件。只需检查一下即可。例如,如果您有 foo,v 只需执行:

co foo

它就会从 *,v 文件中检出 foo

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

鹤舞 2024-08-29 08:31:54

是的,安装 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 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.

心的憧憬 2024-08-29 08:31:54

最新的 Windows 二进制文件可以在这里找到:

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

例如:
将您的存储库文件放置在此处:c:\cvs
(如 c:\cvs\PROJECT
创建 c:\cvs\CVSROOT

创建 c:\work
在这里保存 cvs.exe

运行:

cvs -d c:\cvs checkout PROJECT

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
绿光 2024-08-29 08:31:54

尝试设置 CVS 客户端并将文件读取为本地 CVS 存储库。

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

じ违心 2024-08-29 08:31:54

根据您的平台,您可能会发现 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.

最好是你 2024-08-29 08:31:54

当有人签入、更新文件以及访问目录/文件时,通常会发生这种情况。

这对我有用-
只需关闭终端并打开一个新的 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文