updateChapter(new, prev, current)
1
.
This function attacks the problem of making updates to a chapter (probably a large
one), when more than one programmer is revising objects in the chapter. One way
to handle multiple programmers is to maintain in a version control system (CVS is
our recommended choice) the objects needed to describe the chapter. Running
make dump
in an S chapter creates files describing the chapter and another file,
DUMP_FILES
, listing what files need to be captured in the version
control system. If this is done, and the current user wants to update the current
chapter corresponding to two revisions of the chapter, the shell script
$SHOME/bin/updataChapter
can be used to create two databases corresponding to a previous committed version
and the new version. After runnng the shell script, call this function in S.
The
updateChapter
function expects three databases. Two of them,
new
and
prev
, should correspond to committed revisions of the objects in
a chapter. The third database is the current, working version of the same chapter.
By default, it is the working data. The goal of the updating is to apply the revisions
in
new
to
current
, leaving it consistent with
new
.
The user is prompted to allow changes to be made, subject to conflicts. Conflicts
exist if any changes in
current
from
prev
are inconsistent
with changes in
new
. No objects in conflict will ever be updated.
Changes in
current
to objects not changed in
new
are not
considered conflicts. The model is that the owner of
current
is revising
the chapter, while some other programmer has also revised it since the version in
prev
. These changes are to be incorporated in the current user's copy.
updateChapter("./newCVS", "./prevCVS", ".")