Source Code Control System SCCS Banyen SaeLee 4322031

Source Code Control System (SCCS( Banyen Sae-Lee 4322031 SCCS 1
![Introduction ]Programmer’s Guide, UNIX System V, AT&T, 1987[ b Is a maintenance and enhancement Introduction ]Programmer’s Guide, UNIX System V, AT&T, 1987[ b Is a maintenance and enhancement](http://slidetodoc.com/presentation_image_h2/f75af55638b9397e240fea21f08abcf3/image-2.jpg)
Introduction ]Programmer’s Guide, UNIX System V, AT&T, 1987[ b Is a maintenance and enhancement tracking tool that runs under the UNIX system ]http: //nacphy. physics. orst. edu/copying-with-unix/node 169. html[ b The source code control system SCCS is a set of commands which helps you keep track of the changes made to source code (or any text) files SCCS 2

Introduction It's like a friendly librarian and accountant for your files who even helps you restore your files to the condition they were in at some previous time. The SCCS is particularly handy when a group is making changes to the same source code or a single person likes to try out lots of changes but keeps forgetting how to get the code back to where it runs. SCCS 3

Basic Operation b. SCCS stores changes to files in a file that is called, logically, An SCCS file. b. The SCCS file is named s. filename, where filename is the file being tracked. b. Each set of changes depending on the previous revision SCCS 4

Basic Operation This is a simple 3 line file Next revision This is a simple three line file SCCS adds only the last line to the SCCS file s. filename and records it as the next revision SCCS 5

SCCS for Beginners b. Creating an SCCS File via admin b. Retrieving a File via get b. Recording Change via delta SCCS 6

Creating an SCCS File via admin file 1. txt This is a simple 3 line $admin –ifile 1. txt s. file 1. txt $ ls –l -rw-r--r-- 1 sbanyen ccstaff 24 Feb 16 13: 17 file 1. txt -r--r--r-- 1 sbanyen ccstaff 178 Feb 16 13: 17 s. file 1. txt is no longer needed because it exists now under SCCS as s. file 1. txt $ rm file 1. txt SCCS 7

Retrieving a File via get $ get s. file 1. txt $ get –e s. file 1. txt 1. 1 3 lines No ID keywords (cm 7) get retrieved version 1. 1 with three lines of text for reading 1. 1 new delta 1. 2 3 lines get creates file 1. txt for both reading and writing SCCS 8

Recording Change via delta $ delta s. file 1. txt comments? Change 3 to three No id keywords (cm 7) 1. 2 1 inserted 1 deleted 2 unchanged SCCS 9

Delta Numbering b Think of deltas as the nodes of a tree in which the root nodes is the original version of the file. b The root is normally named 1. 1 and deltas (nodes) are named 1. 2, 1. 3, etc. b The components of these SIDs are called release and level numbers. SCCS 10

Delta Numbering b This is the normal sequential development of an SCCS file, which each delta dependent on the preceding deltas. b Such struture is called the trunk of an SCCS tree. SCCS 11

Delta Numbering b. There are situation the require branching an SCCS file. That is, changes are planned to a given delta that will not be dependent on all previous deltas. b. Branch delta names always have fours SID components: release. level. branch. sequence SCCS 12

Delta Numbering SCCS 13

Delta Numbering SCCS 14

SCCS commands accept two types of arguments bkeyletters bfilenames SCCS 15

SCCS command badmin initializes SCCS files, manipulates their descriptive text, and controls delta creation rights bget retrieves versions of SCCS files bunget undoes the effect of a get -e prior to the file being deltaed SCCS 16

SCCS command bdelta applies (changes) to SCCS files and creates new versions bprs prints portions of an SCCS file in user specified format bsact print information about the fils that are currently out for edit SCCS 17

SCCS command brmdel removes a delta from an SCCS file allows removal of deltas created by mistake bcdc changes the commentary assocoated with a delta bsccsdif shows differences between any two versions of an SCCS file SCCS 18

SCCS command bwhat searches any UNIX system file(s) for all occurences of a special pattern and prints out what follows it useful in filnding identifying information inserted by the get command bcombines consecutive deltas into one to reduce the size of an SCCS file b Other can see in man pages of Unix. SCCS 19

The admin Command The admin command is used to administer SCCS file. When an SCCS file is created, its parameters are initialized by use of keyletters with admin or are assigned default values if no keyletters are supplied. SCCS 20

The admin Command b Initialize the history file with text from the indicated file. $ admin –ifile 1. txt s. file 1. txt b Create the history file called s. program. c in the SCCS subdirectory. $ create SCCS file 1. txt b Specify the release for the initial delta. $ admin –ifile 1. txt –r 3 s. file 1. txt SCCS 21

The admin Command b SCCS files contain a list of login names and/or group Ids of users who are allowed to create deltas. b This list is empty by default, allowing anyone to create deltas. b To create a user list (or add to an existing one), admin -a is used. For example $admin -assupacho -avpreecha s. file 1. txt SCCS 22

The get Command The get utility retrieves a working copy from the SCCS history file, according to the specified options. The retrieved file normally has the same filename base as the s. file, less the prefix, and is referred to as the g- file. b retrieve a version of an SCCS file $ get s. file 1. txt SCCS 23

The get Command ID keywords (Identification keywords( b In generating a g-file for compilation, it is useful to record the date and time of creation, the version retrieved, the module’s name, etc. within the g-file. b This information appears in a load module when one is eventually created. SCCS 24

The get Command ID keywords (Identification keywords( b ID keywords appearing anywhere in the generated file are replaced by appropriate values according to the definitions of those ID keywords SCCS 25

The get Command ID keywords (Identification keywords( b The format of an ID keyword is an upper case letter emclosed by percent signs, %. For example %I% is the ID keyword replaced by the SID of the retrieved version of a file. SCCS 26

The get Command b Retrieve the version corresponding to the indicated SID (delta). $ get –r s. file 1. txt b Retrieve a version for editing $ get -e s. file 1. txt b Create a new branch. $ get –b –e –r 1. 2 s. file 1. txt SCCS 27

The get Command Retrieval With Intent to Make a Delta get -e indicates an intent to make a delta. First, get checks the following. b The user list to determine if the login name or group ID of the person executing get is present. The login name or group-ID of the person executing get must be present for the user to be allowed to make deltas. SCCS 28

The get Command Retrieval With Intent to Make a Delta b The release number (R) of the version being retrieved statisfies the relation “floor is greater than or equal to R, which is less than or equal to ceiling” to determine if the release being accessed is a protected release. The floor and ceiling are flags in the SCCS file representing start and end of range. SCCS 29

The get Command Retrieval With Intent to Make a Delta b The R is not locked against editing. The lock is a flag in the SCCS file. b Whether multiple concurrent edits are allowed for the SCCS file by the j flag in the SCCS file. SCCS 30

The get Command Retrieval With Intent to Make a Delta b A failure of any of the first three conditions causes the processing of the corresponding SCCS file to terminate. b If the above checks succeed, get -e causes the creation of a g-file in the current directory with mode 644, owned by the real user. SCCS 31

The get Command Retrieval With Intent to Make a Delta b If a writable g-file already exists, get terminates with an error. This is prevent inadvertent destruction of a g-file being edited for the purpose of maling a delta. b get -e causes the creation (or updating) of a p. filename that is used to pass information to the delta command. SCCS 32

The get Command Retrieval With Intent to Make a Delta b The p. filename prevents other users from retrieving the same version for editing until this one is checked in using delta or unget. b Read only copied can be check out. b Can use the -r option for different versions at the same time SCCS 33

The get Command Retrieval With Intent to Make a Delta b However, if two users are making changes to the same file at the same time, the project most likely will have branches in the revision tree. SCCS 34

Undoing a get -e b There may be times when a file is retrieved for editing in error; there is really no editing that needs to be done at this time. In such cases, the unget command can be used to cancel the delta reservation that was set up. SCCS 35

The delta Command b The delta command is used to incorporate changes made to a g-file into the corresponding SCCS file b The delta command requ ires the existence of a p. filename. It examines the p. filename to verify the presence of an entry containing the user’s login name. If none is found, an error message results. SCCS 36

The delta Command b If all checks are successful, delta determines what has been changed in the g-file by comparing it via diff (1) with its own temporary copy of the g-file as it was before editing. b If the login name of the user appears in more than one entry, Then delta -r must be used to specify the SID that uniquely identifies the p. filename entry. SCCS 37

The delta Command $ls -l total 2 -r--r--r-- 1 sbanyen ccstaff 513 Feb 18 10: 24 s. file 1. txt $get -e s. file 1. txt 1. 2 new delta 1. 3 4 lines SCCS 38

The delta Command $ls -l total 6 -rw-r--r-- 1 sbanyen ccstaff 33 Feb 18 10: 24 file 1. txt -rw-r--r-- 1 sbanyen ccstaff 34 Feb 18 10: 24 p. file 1. txt -r--r--r-- 1 sbanyen ccstaff 513 Feb 18 10: 24 s. file 1. txt SCCS 39

The delta Command $delta s. file 1. txt comments? Add comment 1. 3 1 inserted 1 deleted 3 unchanged SCCS 40

The delta Command After the processing of an SCCS file is complete, the corresponding p. filename emtry is removed from the p. filename. delta removes the edited g-file unless -n is specified. For example delta -n s. file 1. txt will keep the g-file after processing. SCCS 41

The prs Command The prs command is used to print all or part of an SCCS file on the standard output. $prs s. file 1. txt D 1. 1 01/02/17 20: 44: 50 sbanyen 1 0 00003/00000 MRs: COMMENTS: date and time created 01/02/17 20: 44: 50 by sbanyen SCCS 42

The prs Command If prs -d is used, the output will be in a format called data specification. Data specification is a string of SCCS file data keywords interspersed with optional user text. Data keywords are replaced by appropriate values according to their definition SCCS 43

The prs Command Example $prs -d "File : M: version: : I: created: : D: " s. file 1. txt File file 1. txt version: 1. 3 created: 01/02/18 SCCS 44

The sact Command sact is like a special form of the prs command that produces a report about files that are out for edit. The command takes only one type of argument: a list of file or directory name. $sact s. file 1. txt 1. 4 1. 3 sbanyen 01/02/18 12: 23: 38 SCCS 45

The rmdel Command The rmdel command allows removal of a delta from an SCCS file. b The delta to be removed must be leaf delta. b The effective user must have write permission is the directory containing the SCCS file. SCCS 46

The rmdel Command b Check the SID to make sure it is not for a version on which a get for editing had been executed and whose associated delta has not yet been made. b The login name or group ID of the user must appear in the file’s user’s list ( or the user list must be empty. ( Example $ rmdel -r 1. 3 s. file 1. txt SCCS 47

The cdc Command The cdc command is used to changed the commentary made when the delta was created. It is similar to the rmdel command (e. g. , -r and full SID are necessary) although the delta need not be a leaf delta. For example $cdc -r 1. 2 s. file 1. txt comments? Change number 3 to three word SCCS 48

The what Command The what command is used to find identifying within any UNIX file whose name is given as an argument. No keyletters are accepted. The what command search the given file(s) for all occurences of the string @(#) which is the replacement for the %Z% ID keyword. SCCS 49

The what Command For example, if an SCCS file called s. file 1. txt contains the following line: Filename is %W% and the command $get s. file 1. txt $what file 1. txt: file 1. txt 1. 3 SCCS 50

The what Command b The string searched for by what need not be inserted via and ID keyword of get; if may be inserted in any convenient manner. SCCS 51

The sccsdiff Command The sccsdiff command determines (and prints on the standard output) the differences between any two versions of an SCCS file. The versions to be compared are specified with sccsdiff -r in the same way as with get -r. SCCS 52

The sccsdiff Command For example $sccsdiff -r 1. 2 -r 1. 3 s. file 1. txt 1 c 1 % >I% %M% --<File name is %W% SCCS 53

The comb Command The comb command lets t he user try to reduce the size of an SCCS file, restructs the file by discarding unwanted deltas and combining other specified deltas. In the absence of any keyletters, comb preserves only leaf deltas and the minimum number of ancestor deltas necessary to preserve the shape of an SCCS tree. SCCS 54

The comb Command Deltas 1. 2, 1. 3. 2. 1, 1. 4 and 2. 1 would be eliminate SCCS 55

Reference b Karen S. Fortgang , UNIX System V (Programmer’s Guide), Prentice-Hall, Inc. , Englewood Cliffs, NJ 07632, 1987. b Robin Burk and David B. Horvath, CCP. , et al. , UNIX Unreleased Internet Edition, Techmedia Monish Plaza, 20, Ansari Road, Darya Ganj, New Delhi-2. , 1998. b ]http: //nacphy. physics. orst. edu/copying-withunix/node 169. html[ SCCS 56
- Slides: 56