如何通过命令行从 CVS 获取新添加文件的具体版本?
我们内部编写的工具之一提供了以下形式的 cvs 提交跟踪:
Checking in src/com/package/AFile.java;
/home/cvs/src/com/package/AFile.java,v <-- Afile.java
new revision: 1.1.2.56; previous revision: 1.1.2.55
done
然后,该工具通过在已经具有特定内容的工作目录中发出 cvs update -r 1.1.2.56
命令来从 cvs 获取文件代码分支已签出。
如果工作目录中存在 AFile.java 的现有版本,则此命令可以正常工作。 但是,当我们跟踪工作目录中没有版本的文件时,该命令无法获取该文件。
有办法做到吗?
One of our internally written tool is fed a cvs commit trace of the form:
Checking in src/com/package/AFile.java;
/home/cvs/src/com/package/AFile.java,v <-- Afile.java
new revision: 1.1.2.56; previous revision: 1.1.2.55
done
The tool then acquires the file from cvs by issuing a cvs update -r 1.1.2.56
command in a working directory that already have specific branch of code checked-out.
This commands work correctly if there is an existing version of AFile.java in working directory. But when we get a trace of a file that has no version in working directory the command is not able to acquire the file.
Is there a way to do it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
目前尚不清楚您的最终目标是什么:使整个存储库进入所需状态(选择所选分支的修订版)或从存储库获取单个文件以进行进一步处理。 我认为是后者。
然后,您需要这个命令:
这将转储到标准输出指定文件(或多个文件)的指定版本,可以将其重定向到临时位置并进行处理。
或者您可以使用:
,它将(部分)存储库导出到指定的目标目录。
It is not clear what is your final goal: to bring whole repository into required state (choosen revision of the choosen branch) or to acquire the single file from the repository for further processing. I assume it is the latter.
Then, you need this command:
This will dump to stdout specified revision of the specified file (or files), which could be redirected into temporary location and processed.
Or you could use:
, which would export (part of) repository to specified destination directory.
cvs --help
告诉您可以使用
-H
参数查看特定 CVS 命令的帮助,如下所示:...教一个人如何钓鱼.. 。:)
cvs --help
tells you that you can use the
-H
arg to view help on a specific CVS command like so:... teach a person how to fish ... :)
我已经尝试过以下方式,
但出现了类似的错误,
所以我已经按照以下方式完成了,
现在效果很好。
I have tried as below way
It was giving error like
So i have done as below way
Now it worked fine.
一种解决方案是更改工具来为文件发出“cvs co”,指定当前更新的修订版本。 签出命令必须从树的顶部完成,而不是在包含该文件的目录中完成。 我遇到过类似的情况,更新无法找到新文件,需要按照我的描述签出该文件。
One solution would be to change the tool to issue a "cvs co" for the file, specifying the revision as is being now with the update. The checkout command would have to be done from the top of your tree, not in the directory containing the file. I've come across similar cases where the update fails to find a new file, requiring a checkout of the file as I've described.
这是对我有用的唯一方法,因为 checkout 命令总是给出“找不到模块”错误:
似乎 cvs 在这方面失败了。
This is the only way that works for me, as the checkout command always gives a "module not found" error:
It seems that cvs dropped the ball on this.
我这样做了:
I did this: