Intel XENIX 286 Programmers Guide (86) - Tenox.tc

Intel XENIX 286 Programmers Guide (86) - Tenox.tc Intel XENIX 286 Programmers Guide (86) - Tenox.tc

09.06.2013 Views

CHAPTER 5 SCCS : SOURCE CODE CONTROL SYSTEM The Source Code Control System (SCCS) is a collection of XENIX commands that create, maintain, and control special files called SCCS files. The SCCS commands can create and store multiple versions of a program or docum ent in a single file instead of in one file for each version. The commands can retrieve any version you wish at any time, make changes to this version, and save the changes as a new version of the file in the sees file. The SCCS system is useful wherever you require a compact way to store multiple versions of the same file. SCCS provides an easy way to update any given version of a file and explicitly record the changes made. The commands are typically used to control changes to multiple versions of source programs, but may also be used to control multiple versions of manuals, specifications, or other documentation. This chapter explains how to make SCCS files, how to update the files contained in sees files, and how to maintain sees files once they are created. Basic Information This section provides some basic information about SCCS. In particular, it describes • sees files and directories • Deltas and SIDs • sees working files • sees command arguments • File administration Files and Directories All sees files (also called s-files) are originally created from text files containing documents or programs created by a user. The text files must have been created using a XENIX text editor such as vi. Special characters in the files are allowed only if they are also allowed by the given editor. 5 - 1

SCCS: Source Code Control System XENIX Programming To simplify s-file storage, all logically related files (e.g., files belonging to the same project) should be kept in the same directory. Such directories should contain only sfiles and should have read and search permission for everyone and write permission for the user alone. Note that you must not use the XENIX link command to create multiple links to an sfile. Deltas and SIDs Unlike an ordinary text file, an s-file contains nothing more than lists of changes. Each list corresponds to the changes needed to construct exactly one version of the file. The lists are combined to create the desired version from the original. Each list of changes is called a delta. Each delta has an identification string called an SID. The SID is a string of at least two and at most four numbers separated by periods. The numbers name the version and define how it is related to other versions. For example, the first delta is usually numbered "1.1" and the second "1.2". The first number in any SID is called the release nu mber. The release number usually indicates a group of versions that are similar and generally compatible. The second number in the SID is the level nu mber. It indicates major differences between files in the same release. An SID may also have two optional numbers. The branch number, the optional third number, indicates changes at a particular level, and the sequence number, the fourth number, indicates changes at a particular branch. For example, the SIDs "1.1. 1.1" and "1.1.1.2" indicate two new versions that contain slight changes to the original delta 1.1. An s-file may at any time contain several different releases, levels, branches, and sequences of the same file. In general, the maximum number of releases an s-file may contain is 9999, that is, release numbers may range from 1 to 9999. The same limit applies to level, branch, and sequence numbers. When you create a new version, SCCS usually creates a new SID by incrementing the level number of the original version. If you wish to create a new release, you must explicitly instruct the system to do so. A change to a release number indicates a major new version of the file. How to create a new version of a file and change release numbers is described later. SCCS creates a branch and sequence number for the SID of a new version if the next higher level num ber already exists. For example, if you change version 1.3 to create a version 1.4 and then change 1.3 again, the SCCS system creates a new version named 1.3.1.1. Version numbers can become quite complicated. In general, it is wise to keep the numbers as simple as possible by carefully planning the creation of each new version. 5-2

SCCS: Source Code Control System <strong>XENIX</strong> Programming<br />

To simplify s-file storage, all logically related files (e.g., files belonging to the same<br />

project) should be kept in the same directory. Such directories should contain only sfiles<br />

and should have read and search permission for everyone and write permission for<br />

the user alone.<br />

Note that you must not use the <strong>XENIX</strong> link command to create multiple links to an sfile.<br />

Deltas and SIDs<br />

Unlike an ordinary text file, an s-file contains nothing more than lists of changes. Each<br />

list corresponds to the changes needed to construct exactly one version of the file. The<br />

lists are combined to create the desired version from the original.<br />

Each list of changes is called a delta. Each delta has an identification string called an<br />

SID. The SID is a string of at least two and at most four numbers separated by periods.<br />

The numbers name the version and define how it is related to other versions. For<br />

example, the first delta is usually numbered "1.1" and the second "1.2".<br />

The first number in any SID is called the release nu mber. The release number usually<br />

indicates a group of versions that are similar and generally compatible. The second<br />

number in the SID is the level nu mber. It indicates major differences between files in<br />

the same release.<br />

An SID may also have two optional numbers. The branch number, the optional third<br />

number, indicates changes at a particular level, and the sequence number, the fourth<br />

number, indicates changes at a particular branch. For example, the SIDs "1.1. 1.1" and<br />

"1.1.1.2" indicate two new versions that contain slight changes to the original delta 1.1.<br />

An s-file may at any time contain several different releases, levels, branches, and<br />

sequences of the same file. In general, the maximum number of releases an s-file may<br />

contain is 9999, that is, release numbers may range from 1 to 9999. The same limit<br />

applies to level, branch, and sequence numbers.<br />

When you create a new version, SCCS usually creates a new SID by incrementing the<br />

level number of the original version. If you wish to create a new release, you must<br />

explicitly instruct the system to do so. A change to a release number indicates a major<br />

new version of the file. How to create a new version of a file and change release<br />

numbers is described later.<br />

SCCS creates a branch and sequence number for the SID of a new version if the next<br />

higher level num ber already exists. For example, if you change version 1.3 to create a<br />

version 1.4 and then change 1.3 again, the SCCS system creates a new version named<br />

1.3.1.1.<br />

Version numbers can become quite complicated. In general, it is wise to keep the<br />

numbers as simple as possible by carefully planning the creation of each new version.<br />

5-2

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!