A watch is the conventional name for CVS's feature to notify users of the
repository whenever a file has been changed or a developer has started editing
a file. The usage of watches requires that the file
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
Cervisia's main support of watches are six menu items.
In order to add a watch to one or several files, use → . 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 committed, check the boxes and . If you want to get notified about any event related to the marked files, check the box . The command line used when you accept the dialog is
cvs watch add -a commit
or with a similar option, depending on the events you chose to watch.
If you are not interested in some files anymore, you can remove your watches on them. To this end, use → . 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
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 → . Using this menu item will result in a command
In the normal usage scenario of CVS, each developer works separately in his checked out sandbox. When he wants to modify some file, he can just open it in his editor and start working on it. Nobody else will know about this work until the file gets committed.
For some developer groups, this is not the preferred model of cooperation. They want to get notified about someone working on a file as soon as he starts with it. This can be achieved by some further CVS commands. Before you start editing a file, select it in Cervisia's main window and choose → . This will execute the command
This will send out a notification to everyone who has set an
edit watch on this file. It will also register you as an
editor of the file. You can obtain a list of all editors
of a certain file by using
→ . This is equivalent to typing on the
An editing session is automatically ended when you commit the affected file.
At that moment, an
unedit notification gets sent out to all
people who have registered a respective watch on the file. Of course,
sometimes you may not want to commit the file, but abort the editing session
and revert to the previous version of the file. This is done by using
Note that Cervisia will not ask you for confirmation; that means if you use
this menu item, all your work done since you used
will be lost. Precisely, Cervisia uses the command line
echo y | cvs unedit
So far, we have only discussed the case where edits and unedits are used voluntarily be the developers. In addition CVS supports a model which enforces the usage of these commands. The responsible command to switch to this model is cvs watch on which we will not explain further because it is mostly used by the administrator of the repository. However, the important point from the developer's point of view is that when the project enforces edits, working copies are checked out readonly. That means you cannot edit a file by default (unless you use tricks like chmod). Only when you use → , the file becomes writable. It is made read-only again when you commit the file or use → .
Cervisia's editor interface helps you with projects that enforce watches also in a different way. If you just started an editor with a readonly file by double-clicking on it or by using → , you would not be able to 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.
In such a case, it is advisable to check the option → . 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 committed files are read-only again.