获取 CVS 中文件前两个版本之间的差异
有没有办法在 CVS 存储库中创建文件的前两个修订版本的差异?我不关心修订号和我本地的签出文件。我所需要的只是最后一次提交和提交前最后一次的黑白差异。
Is there way to create the diff of a file b/w its top two revisions in the CVS repo? I doesn't care about the revision numbers and my local checked-out file. All I need is, the diff b/w the last commit and the last before commit.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以用来
比较两个修订版。
也许可以直接进行您需要的比较,但我们也可以通过处理
cvs log filename
的结果来自动化它。因此,例如,您获得最新版本号和上一个版本号
您想要将它们合并在一起,因此创建一个 BASH 脚本文件(例如名为 lastdiff.sh),其中包含
:将能够通过使用文件名作为参数执行它来获取差异,例如
./lastdiff.sh
文件名。You can use
to compare two revisions.
It may be possible to do the comparison you require directly, but we can also automate it by processing the results of
cvs log filename
. So, for example, you get the latest revision number withand the previous revision with
You want to merge these together, so create a BASH script file (say called lastdiff.sh) that contains:
and then you'll be able to get your diff by executing it with the filename as a parameter, e.g.
./lastdiff.sh
filename.您可以使用
cvs diff
来找出本地检出版本和头部存在的版本之间的差异。You can use
cvs diff
to find out the differences between the local checked out version and the version present on the head.我曾希望我缺少一个明显的 cvs 选项,但 borrible 的脚本解决方案似乎就是这样。如果出于某种原因您仍在使用 cvs,您可能会发现这种改进很有用:
这使用 sed 从一次“cvs log”调用中获取两个最新修订版本,并直接从该输出创建 -r 选项。
I had hoped there was an obvious cvs option I was missing, but borrible's scripted solution seems to be it. If for whatever reason you're still using cvs, you might find this refinement useful:
This uses sed to both grab the two latest revisions from a single invocation of "cvs log" and create the -r options directly from that output.