如何在不检出实际文件的情况下获取CVS / *文件? [英] How to get CVS/* files without checking out the actual files?

查看:112
本文介绍了如何在不检出实际文件的情况下获取CVS / *文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的脚本取决于CVS / *文件,但实际上并不需要所有文件。是否可以只获取CVS / *文件而无需实际从存储库中签出所有文件?
检出所有文件会花费大量时间。

My scripts depends on CVS/* files, but does not require actually having all the files. Would it be possible just to get CVS/* files without actually checking out all files from the repository? Checkout of all the files costs a lot of time.

推荐答案


当前仅对来自不同标签的两个Entries文件进行比较,并输出XML / JSON或人类可读的信息,标签之间的区别在于:删除,新建,向下修订,向上修订。 – davidlt

currently it only does comparison between two Entries files from different tags and output XML/JSON or human readable information with the difference between tags: deleted, new, revision down, revision up. – davidlt

您的方法存在一些问题。您已经知道第一个:即使您不关心实际文件,也需要签出标签。

There are a few problems with your approach. You already know about the first: needing to check out the tags, even though you don't care about the actual files.

另一个问题是CVS / *文件是本地的,可以编辑和/或破坏。同样,如果您进行部分签出,则Entries文件将仅包含您签出的内容,而不包含与teh标签关联的所有内容。因此,不能保证此文件是真相的来源。

Another problem is that the CVS/* files are local and can be edited and/or corrupted. Also if you do a partial checkout, the Entries file will only contain the content you checked out rather than everything associated with teh tag. This file therefore can't be guaranteed as a source of "truth".

如果您只是更改了什么文件,则可以使用 rdiff -s 选项。

If you are just after what files have changed, you can use the rdiff -s option.

rdiff选项文档说:


-s

-s

创建摘要更改报告而不是补丁。摘要包含有关版本之间更改或添加的文件的信息。它被发送到标准输出设备。例如,这对于查明在两个日期或修订之间哪些文件已更改非常有用。

Create a summary change report instead of a patch. The summary includes information about files that were changed or added between the releases. It is sent to the standard output device. This is useful for finding out, for example, which files have changed between two dates or revisions.

文档还包含此示例


假设您已经发布了1.3版,并分支了一个名为 R_1_3fix 的分支来进行错误修复。 R_1_3_1 对应于1.3.1版本,该版本是在一段时间之前制作的。现在,您想看看在分支上已经完成了多少开发。可以使用以下命令:

Suppose you have made release 1.3, and forked a branch called R_1_3fix for bug fixes. R_1_3_1 corresponds to release 1.3.1, which was made some time ago. Now, you want to see how much development has been done on the branch. This command can be used:

$ cvs patch -s -r R_1_3_1 -r R_1_3fix module-name
cvs rdiff: Diffing module-name
File ChangeLog,v changed from revision 1.52.2.5 to 1.52.2.6
File foo.c,v changed from revision 1.52.2.3 to 1.52.2.4
File bar.h,v changed from revision 1.29.2.1 to 1.2


我已运行

cvs rdiff -s -r v5_8_0_1 -r v5_8_0_2 <module>

File abc is new; v5_8_0_2 revision 1.1.2.2
File xyz is removed; v5_8_0_1 revision 1.1.4.1

编辑:

您没有指定正在使用的平台,但是cvs命令的非均匀输出肯定可以通过清除命令传递,以使其更易于管理。例如。以下awk会将其转换为CSV输出,仅包含您感兴趣的四条信息。

You don't specify what platform you are on, but the non-uniform output from the cvs command could certainly be passed through a cleansing command to make it easier to manage. eg. The following awk would turn it into CSV output with only the four pieces of information you are interested in.

cvs rdiff -s -r <tag1> -r <tag2> <module> | awk '
    / new; /     { print "NEW, \"" $2 "\", , " $7 }
    /changed /   { print "CHANGED, \"" $2 "\", " $6 ", " $8 }
    / removed; / { print "REMOVED, \"" $2 "\", " $7 ", " }
'

这篇关于如何在不检出实际文件的情况下获取CVS / *文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆