DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Tracking versions with SCCS

delta

The delta command is used to incorporate changes made to a g-file into the corresponding SCCS file -- that is, to create a delta and, therefore, a new version of the file.

The delta command requires the existence of p.file (created by get -e). It examines p.file to verify the presence of an entry containing the user's login name. If none is found, an error message results.

The delta command performs the same permission checks that get -e performs. If all checks are successful, delta determines what has been changed in the g-file by comparing it with its own temporary copy of the g-file as it was before editing. This temporary copy is called d.file and is obtained by performing an internal get on the SID specified in the p.file entry.

The required p.file entry is the one containing the login name of the user executing delta, because the user who retrieved the g-file must be the one who creates the delta. However, if the login name of the user appears in more than one entry, the same user has executed get -e more than once on the same SCCS file. Then, delta -r must be used to specify the SID that uniquely identifies the p.file entry. This entry is then the one used to obtain the SID of the delta to be created.

In practice, the most common use of delta is

   $ delta s.abc
which prompts
   comments?
to which the user replies with a description of why the delta is being made, ending the reply with a new-line character. The user's response may be up to 512 characters long with new-lines (not intended to terminate the response) escaped by backslashes (\).

If the SCCS file has a v flag, delta first prompts with

   MRs?
(Modification Requests) on the standard output. The standard input is then read for MR numbers, separated by blanks and/or tabs, ended with a new-line character. A Modification Request is a formal way of asking for a correction or enhancement to the file. In some controlled environments where changes to source files are tracked, deltas are permitted only when initiated by a trouble report, change request, trouble ticket, and so on, collectively called MRs. Recording MR numbers within deltas is a way of enforcing the rules of the change management process.

delta -y and/or -m can be used to enter comments and MR numbers on the command line rather than through the standard input, as in

   $ delta -y"descriptive comment" -m"mrnum1 mrnum2" s.abc

In this case, the prompts for comments and MRs are not printed, and the standard input is not read. These two keyletters are useful when delta is executed from within a shell procedure. Note that delta -m is allowed only if the SCCS file has a v flag.

No matter how comments and MR numbers are entered with delta, they are recorded as part of the entry for the delta being created. Also, they apply to all SCCS files specified with the delta.

If delta is used with more than one file argument and the first file named has a v flag, all files named must have this flag. Similarly, if the first file named does not have the flag, none of the files named may have it.

When delta processing is complete, the standard output displays the SID of the new delta (from p.file) and the number of lines inserted, deleted, and left unchanged. For example:

1.4
14 inserted
7 deleted
345 unchanged

If line counts do not agree with the user's perception of the changes made to a g-file, it may be because there are various ways to describe a set of changes, especially if lines are moved around in the g-file. However, the total number of lines of the new delta (the number inserted plus the number left unchanged) should always agree with the number of lines in the edited g-file.

If you are in the process of making a delta and the delta command finds no ID keywords in the edited g-file, the message

   No id keywords (cm7)
is issued after the prompts for commentary but before any other output. This means that any ID keywords that may have existed in the SCCS file have been replaced by their values or deleted during the editing process. This could be caused by making a delta from a g-file that was created by a get without -e (ID keywords are replaced by get in such a case). It could also be caused by accidentally deleting or changing ID keywords while editing the g-file. Or, it is possible that the file had no ID keywords. In any case, the delta will be created unless there is an i flag in the SCCS file (meaning the error should be treated as fatal), in which case the delta will not be created.

After the processing of an SCCS file is complete, the corresponding p.file entry is removed from p.file. All updates to p.file are made to a temporary copy, q.file, whose use is similar to that of x.file described under ``SCCS command conventions''. If there is only one entry in p.file, then p.file itself is removed.

In addition, delta removes the edited g-file unless -n is specified. For example

   $ delta -n s.abc
will keep the g-file after processing.

delta -s suppresses all output normally directed to the standard output, other than comments? and MRs?. Thus, use of -s with -y (and/or -m) causes delta neither to read from the standard input nor to write to the standard output.

The differences between the g-file and the d.file constitute the delta and may be printed on the standard output by using delta -p. The format of this output is similar to that produced by diff.


Next topic: admin
Previous topic: Keyletters that affect output

© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005