Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CVS: How prevent files and modules being check-out 2 times

Status
Not open for further replies.

litrevor

Programmer
Nov 18, 2004
3
CA
ClearCase is good, when a developer check out a file to modify, no one else can check it out agian. This way, no conflict will occur.

However, when I come to use CVS, everybody can check out a file, a module at the same time and anytime regardless it being checkout or not. Boy, this way, how can I avoid the conflict when people working on the same file.

Any suggestion appreciated.

Trevor
 
Hi Trevor,

CVS is called CVS (Concurrent Versioning System) because it is meant to enable developers to work on the same file at the same time, not to stop that from happening. So it will never stop you from editing the same file while someone else is modifying it.

There are several ways to work around it though, and they are somewhat documented in the help file. The way we are using: Check out the whole module as READONLY, and after that do a "reserved edit" before you modify a file. You can type in the command "cvs -z9 edit -c <fileName>" or just a push of a button if using WinCVS. If someone has done a reserved edit on that file before you, then a warning message will be displayed and the readonly attribute will still be on, and you won't be able to modify that file. Then after you are done with it, just commit or unedit (to abandon the changes), and the readonly lock will be on again.

But then it would mean your developers will need to remember to reserve edit the file everytime they want to edit it.

Hope it helps,

Ed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top