CVS只读签出 [英] CVS read only check out

查看:90
本文介绍了CVS只读签出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须在项目中使用CVS。到目前为止,我一生都只使用perforce,对CVS一无所知,我阅读了整个CVS手册,但找不到如何做:

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 :

在perforce中,当您检出文件时,首先必须执行p4编辑文件名.C(告诉perforce系统您有意要编辑此文件以最终提交该文件)

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)

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

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

在CVS中,perforce的通常做法是什么?

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

[我喜欢额外的安全性,即在开始这样做之前,必须先明确指示源控制系统您打算编辑文件。这使您可以轻松查看已编辑的文件,还原更改等。此外,还可以通过显式编辑文件来进行临时更改,而无需首先执行p4 edit fileName.C,然后您知道这些操作仅是临时的。更改]

[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]

非常感谢!

推荐答案

您可以执行以下操作

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 ...

或者,忽略-r,而只需设置CVSREAD环境变量。

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

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

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


-r

-r

将新的工作文件设为只读。
与设置$ CVSREAD
环境变量的效果相同(请参见CVS
手册中的节点
环境变量)。缺省情况是使
工作文件可写,除非启用了监视
(请参阅CVS
手册中的监视节点)。

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).

示例:

$ 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

这篇关于CVS只读签出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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