Previous: RCS and SCCS, Up: Customizing VC
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
. If it is 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>, see Merging).
The variable vc-cvs-global-switches
, if non-nil
,
should be a string specifying switches to pass to CVS for all CVS
operations.
When vc-cvs-stay-local
is 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 vc-cvs-stay-local
to nil
,
then VC queries the remote repository before it decides what to
do in 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.