The K Desktop Environment

4.2. Using watches

A watch is the conventional name for CVS's feature to notify users of the repository whenever a file has been changed. The usage of watches requires that the file $CVSROOT/CVSROOT/notify has been set up properly. This is not discussed here; if you need further information on the setup from the administrator's point of view, read one of the books listed in the appendix.

Cervisia's main support of watches are three menu items. In order to add a watch to one or several files, use Advanved->Add watch.... In the dialog you get, you can choose to get notified for any of the types of events that CVS supports. For example, if you only want to get notified when a file is commited, check the boxes Only and Commits. If you want to get notified about any event related to the marked files, check the box All. The command line used when you accept the dialog is

 cvs watch add -a commit filenames

or with a similar option, depending on the events you chose to watch.

If you not interested into some files anymore, you can remove your watches on them. To this end, use Advanved->Remove watch.... In the dialog you get here, the same options are offered as in the form you filled out when adding the watch. When you confirm this dialog, Cervisia issues the command

 cvs watch remove filenames

possibly with an option -a for the chosen events.

Finally, you can get a list of the people who are watching a couple of files. Choose Advanved->Show watchers. Using this menu item will result in a command

 cvs watchers filenames

Cervisia's editor interface helps you with projects that use watches. In such projeccts, files that are watched are checked out readonly. If you would just start an editor with such a readonly file, you cannot save your modifications later. This has of course a reason: Whenever you want to change a file, you should run cvs edit before, so that all people watching the file get a notification that you are working on it.

If you are working with watched files, it is advisable to check the option Options->Do cvs edit automatically when necessary. Now, whenever you edit a file by double-clicking it, Cervisia will run cvs edit before the editor is actually executed. Then you can edit your file as usual. When you have finished your work, commit your files, and the commited files are readonly again.