SCCS

Source Code Control System

SCCS has been around a while and is mentioned in most UNIX/ULTRIX books. It's a method of managing revisions of a program. When a new version of a file (the sccs jargon for this is a delta) is put into SCCS form only the differences between it and the older version is stored, for reasons of economy. The commands can be used directly or via the sccs preprocessor. I suggest that you use the preprocessor; you use this by prefacing the command with 'sccs'. The preprocessor expects that an SCCS directory is available within the directory that contains your files and that this directory also contains the SCCS files. The SCCS directory is owned by sccs, providing an additional level of security, so root will have to make it for you. The files in the SCCS directory are called s-files in the documentation; their names begin with "s." To create an s.file from scratch, use

     sccs create filename  
or
 sccs admin -ifilename filename
This doesn't remove the original file.

When you initially sccs a file, you can only annotate the delta by using

    sccs admin -imain.c -y"First Release" main.c
With subsequent modifications you are prompted for a comment if you don't use the -y option.

You can use the ksh shell script below to sccs all your files at once.

     for file in (*.[.ch])
     do
        sccs admin -i$file $file
     done
An SID is an identification number for a modification (a `delta'). The first delta is usually 1.1 and succeeding versions will be 1.2, 1.3 etc unless you ask for branches to be made. To prepare an s-file for branching do
     sccs admin -fb filename.

     sccs admin -ifilename -fb filename.
creates an s-file that is ready to accept branches straight away.

For a full list of commands and options, see man sccs etc. Here are some examples to get you started

To make a new delta,

     sccs edit filename
This changes SCCS/s.filename to SCCS/p.filename to show that the file is out for editing, and pulls the file out. Any file with the same name is overwritten. If you have the new version of the file already in the directory and don't want to rewrite it, do
     sccs edit -g filename
Then when you have edited it, do
     sccs delta filename
You will be prompted to add a comment to the delta.
     sccs delta `sccs tell` 
deltas all out-for-edit versions To get out a particular version use
   sccs get -r[revision] filename 
To correct a delta (not make a new one)
   sccs fix -r[rev] filename
then edit and do
   sccs delta filename
NB: when you fix 1.2.1.1 it get delta'd back as 1.3. A bug.

To remove a delta,

   sccs rmdel -r[rev] filename  
To make a branch use the `-b' option.
   sccs edit -r1.2 -b filename 
will create a branch from 1.2. When you have edited the file and do a delta, the delta will have SID 1.2.1.1.

To compare the file out for edit with the latest SCCS trunk version, try

   sccs diffs  filename
   sccs sccsdiff -r1.1 -r1.2
This will compare the two SCCS versions. To get information on the deltas of a file, type
   sccs prs filename
You'll get an output something like:
---------------------------------------------------------
D 1.3 86/06/06 16:59:47 root 3 2	00011/00001/00101
MRs:
COMMENTS:
added header file dependancies


D 1.2 86/02/11 12:06:27 root 2 1	00001/00012/00101
MRs:
COMMENTS:
CUED mods. Deleted sccs stuff.


D 1.1 86/02/11 10:42:02 root 1 0	00113/00000/00000
MRs:
COMMENTS:
Initial revision
---------------------------------------------------------
The numbers on the far right tell you
			 lines_added/lines_removed/lines_unchanged 
   sccs edit -r2 SCCS
changes release number of all files

Notes:-

  1. don't go mad on branches; sccs has a bias against them. E.g. For commands which have an -r[rev] option the default is the most recent trunk rev, not the most recent branch.

  2. When you create an sccs file it will come up with a warning "No id keywords (cm7)". Don't worry about this.

  3. See the SCCS User's Guide, in HP-UX Concepts and Tutorials: Programming Environment for more details. Typing man -k sccs gives you a list of related commands.
tpl@eng.cam.ac.uk