Hi Peter, Locking is a controversial topic on this list, it used to generate a lot of unnecessary traffic, flames etc. I think that the recent, still fresh battle over it will prevent it to happen this time. I am little confused if you want to know how to lock in CVS or WinCvs. It is not the same. CVS is a command line tool, which actually does the job. WinCvs is an interface to this command line utility. It makes the job simpler because you don't have to remember all the commands. Locking in WinCvs is simple - just select the file(s) and click the toolbar with the "key" on it. If the issue is about CVS in general, then it is more complicated. You can lock the files using "cvs admin -l" command. Complication arises because CVS is not really supporting the locking. As Tobias pointed out, you should not lock the files, unless you have no other way. To decide about your working model you should read the following section in CVS manual: Multiple developers->Choosing a model. Generally, in CVS you would rather use the 'edit' mechanism instead of locking. It is something intermidiate between locking model and concurent model. Now, few answers to your questions: >I want to be able to checkout a file so that no other users can check out >and edit that same file at the same time. Can not be done in CVS. People can always obtain the file and edit it. However, if you lock the file you will prevent the others from commiting the changes before the lock is released. This will lead to many troubles as people will not know about the locks until the make an effort to check it. The is no easy way to check if the files is locked, but it is possible. You can use the graph in WinCvs to do that (watch the output window when select the revision). You can also try to lock the file yourself. Then you will see the message if it is already locked. I generally suggest using the 'edit'. You might browse archives of this list to get "cvs edit -c" patch. >This is the command to check out the source, yes. cvs checkout dir >So do I just insert a -L in this command to have the source locked? No. "cvs checkout dir" is used to get the local copy of the files in repository. Use "cvs admin -l" to lock the files. Think twice (or more) before you lock any files! >Also, will the same user be able to checkout other files and lock them into >a seperate working dorectory at the same time? Other users can always checkout. Only one user can lock at a time. Other can still checkout and edit the file. They can not commit the changes before the lock is released. The lock is released if the locking user commits his changes and the files he commits were modified. Otherwise lock stays. This leads to left-over locks, one more reason to no lock the files BTW. >If someone (by mistake) goes to checkout a file that is already checked out >& locked by them, will they be told that the file has been already checked >out and locked? NO. You only get the information about locks when: 1. You try to lock the file is already locked by someone else. 2. You try to commit the changes and the file is already locked by someone else. 3. Use the log command. >I have a directory in CVS which contains multiple related files. Is it >possible to checkout and lock only one specified file at a time from that >directory and place it into my working directory, leaving the rest of the >files availabe to be checked out? Files are always available to be checket out. It is not related to the locking at all. Locking only prevents the changes to be commited to the repository by users who didn't lock the file. >PS: Sorry if my questions may seem a little basic, but I'm quite new to CVS >& I'm using it as part of my final year degree project. That means that you still have a lot of research to do :) I think you shuould really read the whole manual of CVS, few times. Then look at the other kind of version control software to have a balance. Also, follow this link: http://devguy.com/fp/ProgrammersCanvas/ Hope that helps. Remember that the advantage of CVS is that you may work without lockig, at least 99% of the time. For the rest 1% you will use locks, but locks are not supported (on purpose, for ideological reasons) an thus it will be a painful experience. BR, Jerzy The first thing they don't teach you at school: "Never say never". All the issues not related to the list please send to me in private, thanks. ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com
