By default, CVS does not use locking to coordinate the activities of several users; anyone can change a work file at any time. However, there are ways to restrict this, resulting in behavior that resembles locking.
For one thing, you can set the CVSREAD environment variable (the value you use makes no difference). If this variable is defined, CVS makes your work files read-only by default. In Emacs, you must type C-x v v to make the file writable, so that editing works in fact similar as if locking was used. Note however, that no actual locking is performed, so several users can make their files writable at the same time. When setting CVSREAD for the first time, make sure to check out all your modules anew, so that the file protections are set correctly.
Another way to achieve something similar to locking is to use the
watch feature of CVS. If a file is being watched, CVS makes it
read-only by default, and you must also use C-x v v in Emacs to
make it writable. VC calls
cvs edit to make the file writable,
and CVS takes care to notify other developers of the fact that you
intend to change the file. See the CVS documentation for details on
using the watch feature.
When a file's repository is on a remote machine, VC tries to keep
network interactions to a minimum. This is controlled by the variable
vc-cvs-stay-local. There is another variable,
vc-stay-local, which enables the feature also for other back
ends that support it, including CVS. In the following, we will talk
vc-cvs-stay-local, but everything applies to
vc-stay-local as well.
t (the default), then VC uses
only the entry in the local CVS subdirectory to determine the file's
state (and possibly information returned by previous CVS commands).
One consequence of this is that when you have modified a file, and
somebody else has already checked in other changes to the file, you
are not notified of it until you actually try to commit. (But you can
try to pick up any recent changes from the repository first, using
C-x v m <RET>,
t, VC also makes local
version backups, so that simple diff and revert operations are
completely local (see Version Backups).
On the other hand, if you set
then VC queries the remote repository before it decides what to
vc-next-action (C-x v v), just as it does for local
repositories. It also does not make any version backups.
You can also set
vc-cvs-stay-local to a regular expression
that is matched against the repository host name; VC then stays local
only for repositories from hosts that match the pattern.
You can specify additional command line options to pass to all CVS
operations in the variable
switches are inserted immediately after the
cvs command, before
the name of the operation to invoke.