CVS 只读签出

发布于 2024-07-27 18:59:41 字数 438 浏览 1 评论 0原文

我必须在项目中使用CVS。 到目前为止,在我的整个工作生涯中,我只使用过perforce,而且我对CVS一无所知,我阅读了整个CVS手册,但找不到如何做到这一点:

在perforce中,当你签出一个文件时,你首先有执行 p4 edit filename.C (告诉 perforce 系统您有意编辑此文件,并最终提交它)

在 CVS 中,当我通过执行 cvs co fileName.C 签出文件时,该文件是已经处于准备编辑状态。

CVS 中与 perforce 中的通常做法等效的是什么?

[我喜欢在开始编辑文件之前必须首先明确指示源代码管理系统您编辑文件的意图的额外安全性。 这使您可以轻松查看已编辑的文件、恢复更改等。此外,您还可以通过显式编辑文件来进行临时更改,而无需先执行 p4 edit fileName.C,稍后您就知道这些只是临时的更改]

非常感谢!

I have to use CVS in a project. So far in my whole working life, I have used only perforce and I do not know anything about CVS, I read the whole CVS manual but could not find how to do this :

In perforce, when you check out a file, you first have to do a p4 edit filename.C (telling the perforce system that you are intentionally about to edit this file with the intention of eventually submitting it)

In CVS, when I checked out a file by doing cvs co fileName.C, the file is already in ready-to-edit state.

What is the equivalent in CVS of what is the usual practice in perforce?

[I like the additional safety of having to first explicitly instructing the source control system of your intention of editing the file before you start doing so. This allows you to easily look at the files that you have edited, revert changes etc. In addition, you can also make temporary changes by explicitly editing files without first doing p4 edit fileName.C and later you know that you meant these only as temporary changes]

Many Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

扛刀软妹 2024-08-03 18:59:41

您可以执行以下操作:

cvs -r checkout ....

然后,当您想要编辑文件时,您必须

cvs edit filename

此外,如果您希望提交将文件返回为只读,您必须

cvs -r commit ...

或者忘记 -r 并仅设置 CVSREAD 环境变量。 容易多了!

从 CVS 手册页的全局选项部分:

-r

将新工作文件设置为只读。
与 $CVSREAD 效果相同
设置环境变量(参见节点
CVS 中的环境变量
手动的)。 默认是使
工作文件可写,除非手表
已打开(请参阅 CVS 中的节点“Watches”
手册)。

例子:

$ cvs -r checkout baz
cvs checkout: Updating baz
U baz/file
$ ls -l baz/file
-r--r--r-- 1 rfeany None 13 Jul 17 21:08 baz/file
$ cvs edit baz/file
$ ls -l baz/file
-rw-r--r-- 1 rfeany None 13 Jul 17 21:08 baz/file

You can do something like this:

cvs -r checkout ....

then when you want to edit a file, you must

cvs edit filename

Also, if you want commit to return the files to read-only, you must

cvs -r commit ...

Or, forget about the -r and just set the CVSREAD environment variable. Much easier!

From the CVS man page, in the global options section:

-r

Make new working files read-only.
Same effect as if the $CVSREAD
environment variable is set (see node
Environment variables in the CVS
manual). The default is to make
working files writable, unless watches
are on (see node `Watches' in the CVS
manual).

Example:

$ cvs -r checkout baz
cvs checkout: Updating baz
U baz/file
$ ls -l baz/file
-r--r--r-- 1 rfeany None 13 Jul 17 21:08 baz/file
$ cvs edit baz/file
$ ls -l baz/file
-rw-r--r-- 1 rfeany None 13 Jul 17 21:08 baz/file
于我来说 2024-08-03 18:59:41

CVS 有一个“编辑”命令,它通知服务器您正在编辑文件。 老实说,这个很少被使用。 编辑文件时无需通知系统,通过检查内容是否不同即可轻松确定。

Subversion 具有锁定文件的能力,这可能是您想要做的更多事情。

分布式系统没有这样的概念,因为它们不需要实现它(也没有任何可能的方式)。

顺便说一句,CVS 的选择令人费解。 现在有更好的源代码控制技术。

CVS has an "edit" command, which informs the server that you are editing the file. This is honestly rarely used. There is no need to inform the system when you are editing a file, this can be easily determined by checking if the contents differ.

Subversion has the ability to lock a file, which may be more of what you're trying to do.

Distributed systems have no such notion, as there is no need for them to implement it (nor any possible way).

On a side note, the choice of CVS is puzzling. There are far better technologies for source control available now.

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