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 oncommand 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 onfor 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 addcommandto set yourself as a watcher of the files you want to watch.Issue
cvs editto 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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access