sccs(1)
NAME
sccs − Source Code Control System
SYNTAX
sccs command [command-option] [file] [sccs]
DESCRIPTION
SCCS is a source management system which maintains records of changes made in files within that system. Records stating what the changes were, why and when they were made, and who made them are kept for each version. Previous versions can be recovered, and different versions can be maintained simultaneously. SCCS also insures that two people are not editing the same file at the same time.
The SCCS system has two levels of operation, a preprocessor called sccs and the traditional SCCS commands. The preprocessor sccs() provides an interface with the more traditional SCCS commands, such as get, delta, and so forth. The sccs() interface is a more user-friendly environment for the SCCS user. Some of the commands are more intuitive, such as sccs edit rather than the traditional get -e to retrieve a file for editing. Some commands will perform multiple operations, such as sccs delget that will perform a delta on the file, and then get the changed file back.
The sccs() preprocessor also restructures the method in which SCCS files are stored and manipulated. In the traditional version of SCCS, files (s-files, p-files, and so forth) are stored in the directory that contains the g-files, unless an SCCS directory is explicitly defined with each command. The sccs() preprocessor expects that an SCCS directory is available within the directory that contains the g-files and that this directory also contains the SCCS files. The SCCS directory is owned by sccs, providing an additional level of security. This method also cleans up the directory where the g-files are stored. One other important difference in using the preprocessor is that the file specification is the name of the g-file rather than the name of the s-file when invoking an SCCS command. If SCCS is specified rather than the file name, the SCCS preprocessor handles this in the same manner as the traditional commands handle it. Each s-file in the directory SCCS is acted upon as if explicitly named. Please note that not all sccs() preprocessor commands permit this feature.
The traditional SCCS commands are also included for reference in SEE ALSO. If the sccs() preprocessor is used, small discrepancies may exist due to conflicts between the command parameters and the sccs() preprocessor parameters.
SCCS stores all versions of each file along with the logged data about each version in the s-file. Three major operations can be performed on the s-file.
To retrieve a file for reading or printing use the following command:
sccs get [filename][sccs]
The latest version is retrieved and is NOT intended for edit.
To retrieve a file for edit use the following command:
sccs edit [filename][sccs]
The latest version is retrieved and only one person can edit a given file at one time.
To merge a file back into the s-file use the following command:
sccs delta [filename][sccs]
This is a companion operation to the edit command (Step 2). A new version number is assigned. Comments explaining the changes are saved.
A delta consists of the changes made to a file, not the file itself. All deltas to a given file are stored, enabling you to get a version of the file that has selected deltas removed which gives you the option of removing your selected changes later.
An SID is an identification number for a delta. It consists of two parts, a release number and a level number. The release number normally remains constant but can be changed when major changes in the file are made. The level numbers represent each delta for a given file. A SID can also be used to represent a version number of the entire file.
To create all the source files in a given directory in SCCS format, run the following shell script from csh:
mkdir SCCS save
chown sccs SCCS
foreach i (*.[.ch])
sccs admin -i$i $i
mv $i save/$i
end
Note that to run the chown command, you must be the superuser.
To create a single source file in SCCS format, assuming the presence of the SCCS directory, use the following command:
sccs create <filename>
Because the number and types of commands used within SCCS are many and complex, the following quick reference table is included here. See the Guide to the Source Code Control System for further explanations of commands.
COMMANDS
These commands should all be preceded by sccs.
getGets files for compilation (not for editing). Id keywords are expanded.
−rSIDGet specified version.
−pSend to standard output rather than to the actual file.
−kDo not expand id keywords.
−ilistInclude list of deltas.
−xlistExclude list of deltas.
−mPrecede each line with SID of delta being created.
−cdateDo not apply any deltas created after date.
edit Gets files for editing. Id keywords are not expanded. Should be matched with a delta command after editing.
−rSIDGet specified version. If SID specifies a release that does not yet exist, the highest numbered delta is retrieved and the new delta is numbered with SID
−bCreate a branch.
−ilistInclude list of deltas
−xlistExclude list of deltas
deltaMerge a file retrieved using edit back into the s-file. Collect comments about why this delta was made.
uneditRemove a file that has been edited previously without merging the changes into the s-file.
infoDisplay a list of all files being edited.
−bIgnore branches.
−u[user]
Ignore files not being edited by user .
checkSame as info, except that nothing is printed if nothing is being edited and exit status is returned.
createCreate an s. file and do not remove the associated g-file.
tellSame as info, except that only the file name of files being edited is listed.
cleanRemove all files that can be regenerated from the s-file.
whatFind and print id keywords.
adminCreate or set parameters on s-files.
−ifileCreate, using file as the initial contents.
−zRebuild the checksum in case the file has been corrupted.
−fflagTurn on the flag.
−dflagTurn off (delete) the flag .
−tfileReplace the text in the s-file with the contents of file. If file is omitted, the text is deleted. Useful for storing documentation or design and implementation documents to insure distribution with the s-file.
Useful flags are:
bAllow branches to be made using the -b flag to edit.
dSIDDefault SID to be used on a get or edit.
iCause No Id Keywords error message to be a fatal error rather than a warning.
tThe module type; the value of this flag replaces the %Y% keyword.
fixRemove a delta and reedit it.
delgetDo a delta followed by a get.
deleditDo a delta followed by an edit.
diffsCompare the g-file out for edit with an earlier SCCS version.
sccsdiffCompare any two SCCS versions of a g-file.
helpGiven either a command name, or an sccs message number, this command will provide additional information.
ID KEYWORDS
%Z%Expands to @(#) for the what command to find.
%M%The current module name, for example, prog.c.
%I%The highest SID applied.
%W%A shorthand for “%Z%%M% <tab> %I%”.
%G%.The date of the delta corresponding to the %I%. keyword.
%R%.The current release number, for example, the first component of the %I% keyword.
%Y%Replaced by the value of the t flag (set by admin).
SEE ALSO
admin(1), cdc(1), comb(1), delta(1), get(1), prs(1), rmdel(1), sccshelp(1), unget(1), val(1), what(1), sccsfile(5)
Guide to the Source Code Control System