On Thu, 03 Aug 2000, Annette wrote:
> What is the best way to make a checked in file a read only for Check out?
> Thanks in advance!
> Annette

In order to get this to happen, you need to run the "cvs watch on"
command on the file.

Example (copied from the Coriolis CVS Book):

floss$ cvs -q co myproj
U myproj/README.txt
U myproj/foo.gif
U myproj/hello.c
U myproj/a-subdir/whatever.c
U myproj/a-subdir/subsubdir/fish.c
U myproj/b-subdir/random.c
floss$ cd myproj
floss$ cvs watch on hello.c
floss$

Now, future checkouts of the project to other people (I'm not sure about the
person who ran the 'watch on' command) will show hello.c as being read-only.
In order to edit the file, you need to run 'cvs edit', but chmoding it to
have write permissions works too.
The advantage of the previous command is that if somebody else has set a
watch on the file, they will notified when somebody runs 'cvs edit' on the
file, or if somebody commits the file.

After running cvs edit, if you commit the file to the repository, the working
copy will revert to being read-only.

In order to turn on watches for a whole project, you just cd into the
project directory, and run 'cvs watch on':

floss$ cd myproj
floss$ cvs watch on

IMPORTANT: If somebody else has already checked out the file(s) before
you run this command, then their working copy will not change to
read-only permissions, even if they do an update or checkout on the
project.  However, if they do a commit, then their working copy will
become read-only.  So, in order to implement this policy for a project,
then everyone w/ a working copy of the files will need to manually chmod
them or do a commit.

Also, if the client decides that they want the working copy of EVERY
file they check out to be read-only, then there are two ways to do that.

1. Add the -r option to the checkout command:  'cvs -r co blah blah'
2. Set the CVSREAD environmental var.


Ryan

you should check out the CVS Book published by Coriolis.  Find it at:
http://cvsbook.red-bean.com/cvsbook.html

-------------------------------------------------------

Reply via email to