Source code control system (SCCS)

delta command

The delta(CP) command incorporates 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 a p-file (created by means of get -e). It examines the 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, using diff(C), with its own temporary copy of the g-file as it was before editing. This temporary copy of the g-file is called the 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, in the case of multiple concurrent edits, if the login name of the user appears in more than one entry, then 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 becomes the one used to obtain the SID of the delta to be created.

In practice, the following is the most common use of delta:


This command results in the following prompt:

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 v flag is present, delta first prompts with:

Modification Requests (MRs), is a formal way of asking for corrections or enhancements to a file. After the MRs is specified, the standard output is then read for MR numbers. These are separated by blanks and/or tabs, ending with a new-line character. In some controlled environments where changes to source files are tracked, deltas are permitted only when initiated by a trouble report/ticket, change request, and so on, collectively known as MRs. Recording MR numbers within deltas is a way of enforcing the rules of the change-management process.

The delta -y and/or delta -m commands can be used to enter comments and MR numbers on the command line rather than through the standard input, for example:

delta -y"descriptive comment" -m"mrnum1 mrnum2"

In this case, the prompts for comments and MRs are not printed, and the standard input is not read. These two key letters are useful when delta is executed from within a shell procedure. See sh(C).

NOTE: The delta -m command is allowed only if the SCCS file v flag is present.

All comments and MR numbers, whether solicited by a delta or supplied by keys, are recorded as part of the entry for the delta being created. They are applicable to all SCCS files specified with the same invocation of the delta.

If delta is used with more than one file argument and the first file named has an SCCS file 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 the p-file) and the number of lines inserted, deleted, and left unchanged. Here is an example:

   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 in 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, in the process of making a delta, delta finds no ID keywords in the edited g-file, the following message is issued after the prompts for commentary but before any other output:

   No id keywords (cm7)
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: In any case, the delta is created unless there is an SCCS file i flag present (meaning the error should be treated as fatal), in which case the delta is not created.

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

In addition, delta removes the edited g-file unless -n is specified. For example, the following command keeps the g-file after processing:

delta -n

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

The changes made to the g-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(C).

Next topic: admin command
Previous topic: Determination of new SID

© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003