Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Cederqvist P.Version management with CVS 1.11.21.pdf
Скачиваний:
6
Добавлен:
23.08.2013
Размер:
1.11 Mб
Скачать

Chapter 10: Multiple developers

71

notification using cvs watch on. cvs notifies users who have requested unedit notification for any of files.

The files and options are processed as for the cvs watch commands.

If watches are not in use, the unedit command probably does not work, and the way to revert to the repository version is with the command cvs update -C file (see Section A.17 [update], page 120). The meaning is not precisely the same; the latter may also bring in some changes which have been made in the repository since the last time you updated.

When using client/server cvs, you can use the cvs edit and cvs unedit commands even if cvs is unable to successfully communicate with the server; the notifications will be sent upon the next successful cvs command.

10.6.4 Information about who is watching and editing

cvs

watchers [-lR] [files]. . .

[Command]

 

List the users currently watching changes to files. The report includes the files being

 

watched, and the mail address of each watcher.

 

 

The files and options are processed as for the cvs watch commands.

 

cvs

editors [-lR] [files]. . .

[Command]

List the users currently working on files. The report includes the mail address of each user, the time when the user began working with the file, and the host and path of the working directory containing the file.

The files and options are processed as for the cvs watch commands.

10.6.5 Using watches with old versions of CVS

If you use the watch features on a repository, it creates ‘CVS’ directories in the repository and stores the information about watches in that directory. If you attempt to use cvs 1.6 or earlier with the repository, you get an error message such as the following (all on one line):

cvs update: cannot open CVS/Entries for reading: No such file or directory

and your operation will likely be aborted. To use the watch features, you must upgrade all copies of cvs which use that repository in local or server mode. If you cannot upgrade, use the watch off and watch remove commands to remove all watches, and that will restore the repository to a state which cvs 1.6 can cope with.

10.7 Choosing between reserved or unreserved checkouts

Reserved and unreserved checkouts each have pros and cons. Let it be said that a lot of this is a matter of opinion or what works given di erent groups’ working styles, but here is a brief description of some of the issues. There are many ways to organize a team of developers. cvs does not try to enforce a certain organization. It is a tool that can be used in several ways.

Reserved checkouts can be very counter-productive. If two persons want to edit di erent parts of a file, there may be no reason to prevent either of them from doing so. Also, it is

72

CVS—Concurrent Versions System v1.11.21

common for someone to take out a lock on a file, because they are planning to edit it, but then forget to release the lock.

People, especially people who are familiar with reserved checkouts, often wonder how often conflicts occur if unreserved checkouts are used, and how di cult they are to resolve. The experience with many groups is that they occur rarely and usually are relatively straightforward to resolve.

The rarity of serious conflicts may be surprising, until one realizes that they occur only when two developers disagree on the proper design for a given section of code; such a disagreement suggests that the team has not been communicating properly in the first place. In order to collaborate under any source management regimen, developers must agree on the general design of the system; given this agreement, overlapping changes are usually straightforward to merge.

In some cases unreserved checkouts are clearly inappropriate. If no merge tool exists for the kind of file you are managing (for example word processor files or files edited by

Computer Aided Design programs), and it is not desirable to change to a program which uses a mergeable data format, then resolving conflicts is going to be unpleasant enough that you generally will be better o to simply avoid the conflicts instead, by using reserved checkouts.

The watches features described above in Section 10.6 [Watches], page 68 can be considered to be an intermediate model between reserved checkouts and unreserved checkouts. When you go to edit a file, it is possible to find out who else is editing it. And rather than having the system simply forbid both people editing the file, it can tell you what the situation is and let you figure out whether it is a problem in that particular case or not. Therefore, for some groups it can be considered the best of both the reserved checkout and unreserved checkout worlds.

Соседние файлы в предмете Электротехника