Watching a File
CVS provides a set of commands to notify users when a file is being
edited or committed. You can use these commands to monitor what each
member of your team is doing and reduce the necessity of merging
files when cvs update
is run. Together, the
cvs watch
,
cvs edit
, and cvs unedit
commands make up the
watch
method of exclusive
development,
which is a lightly enforced method
of exclusive development.
The watch method requires the repository administrator to set up the
notify and users
files in the
CVSROOT
directory of the CVS repository; it
requires the developers to check whether a file is being edited
before they attempt to edit it.
Use cvs watch
like this:
Check out your sandbox, including the files you want to watch.
Issue the
cvs watch on
command to mark files for watching. (This does not set you as the watcher for the files; it just informs CVS that the files can be watched.) Once a file has been marked for watching, it remains marked unless it is cleared withcvs watch off
.Tip
You need to use
cvs watch on
for a file only once, unless someone clears the setting. Usually, your project leader decides which files can be watched and will mark those files for watching.Issue the
cvs watch add
commandIssue
cvs edit
to inform CVS and other users that you intend to edit a specific file. Other users watching the file will be notified that you are editing it.Edit the file in any editor.
Commit your changes ...
Get Essential CVS now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.