DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Using programming tools

Archiving the code

During a software development project it is often desirable to track the changes made to the source code, who made them, and the reasons for the change. In addition, if more than one person is working on the project, it is important that two or more people don't try to make changes to the code at the same time.

SCCS (Source Code Control System) is a maintenance and enhancement tracking tool that provides these capabilities. When changes are made, SCCS identifies and stores them in the file with the original source code or documentation. Any previous version of the file can be reconstructed for inspection or for additional modification. History data can be stored with each version to help remember why, when, and by whom changes were made.

Storing source files under SCCS also prevents two people from accidentally modifying the same file at the same time. To change a file, it must explicitly be checked out for editing. If a version of the file is already checked out for editing, other developers are prevented from checking it out.

If you want a copy of the original version of testcase.c at a later date, it is a good idea to place it under SCCS. This will let you track the changes made to testcase.c as it proceeds through the development procedure. To check testcase.c into SCCS, issue the following command:

admin -itestcase.c -r1 s.testcase.c

The following message is displayed:

   UX:admin:WARNING: No id keywords (cm7)


NOTE: admin issues a warning message: UX:admin:WARNING:No id keywords (cm7). Study the SCCS documentation for information about how to supply an ID keyword.

SCCS creates a file with the name specified on the command line, in this case s.testcase. SCCS adds some lines to the beginning of the file:

   ^Ah22947
   ^As 00117/00000/00000
   ^Ad D 1.1 94/10/07 13:26:29 username 1 0
   ^Ac date and time created 94/10/07 13:26:29 by username
   ^Ae
   ^Au
   ^AU
   ^At
   ^AT
   ^AI 1
   

#include<stdio.h> #include<ctype.h>


NOTE: In the previous output, the ^A denotes a <Ctrl>A.

Once s.testcase.c is under SCCS control, the file must be checked out for editing before any changes can be made. To make changes to s.testcase.c, check it out for editing with the following command:

   rm -e s.testcase.c
   get -e s.testcase.c
SCCS responds with the following message:
   1.1
   new delta 1.2
   66 lines
The result is a file called testcase.c, which is the file we will edit, and a file called p.testcase.c, which SCCS uses to control file access. If anyone tries to access the file once it has been checked out for editing, SCCS issues an error message indicating that the file is already checked out and by whom.
Next topic: Analyzing the code
Previous topic: Creating the source code

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