Download presentation
Presentation is loading. Please wait.
Published byAllan Maximillian Kelley Modified over 10 years ago
1
SCCS1 Source Code Control System (SCCS) Banyen Sae-Lee 4322031
2
SCCS2 Introduction [Programmer’s Guide, UNIX System V, AT&T, 1987] Is a maintenance and enhancement tracking tool that runs under the UNIX system [http://nacphy.physics.orst.edu/copying- with-unix/node169.html] 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
3
SCCS3 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.
4
SCCS4 Basic Operation SCCS stores changes to files in a file that is called, logically, An SCCS file. The SCCS file is named s.filename, where filename is the file being tracked. Each set of changes depending on the previous revision
5
SCCS5 Basic Operation This is a simple three line file Next revision SCCS adds only the last line to the SCCS file s.filename and records it as the next revision This is a simple 3 line file
6
SCCS6 SCCS for Beginners Creating an SCCS File via admin Retrieving a File via get Recording Change via delta
7
SCCS7 Creating an SCCS File via admin file1.t xt This is a sim ple 3 line $ admin –ifile1.txt s.file1.txt $ ls –l -rw-r--r-- 1 sbanyen ccstaff 24 Feb 16 13:17 file1.txt -r--r--r-- 1 sbanyen ccstaff 178 Feb 16 13:17 s.file1.txt file1.txt is no longer needed because it exists now under SCCS as s.file1.txt $ rm file1.txt
8
SCCS8 Retrieving a File via get $ get s.file1.txt 1.1 3 lines No ID keywords (cm7) get retrieved version 1.1 with three lines of text for reading $ get –e s.file1.txt 1.1 new delta 1.2 3 lines get creates file1.txt for both reading and writing
9
SCCS9 Recording Change via delta $ delta s.file1.txt comments? Change 3 to three No id keywords (cm7) 1.2 1 inserted 1 deleted 2 unchanged
10
SCCS10 Delta Numbering Think of deltas as the nodes of a tree in which the root nodes is the original version of the file. The root is normally named 1.1 and deltas (nodes) are named 1.2, 1.3, etc. The components of these SIDs are called release and level numbers.
11
SCCS11 Delta Numbering This is the normal sequential development of an SCCS file, which each delta dependent on the preceding deltas. Such struture is called the trunk of an SCCS tree.
12
SCCS12 Delta Numbering 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. Branch delta names always have fours SID components: release.level.branch.sequence
13
SCCS13 Delta Numbering
14
SCCS14 Delta Numbering
15
SCCS15 SCCS command SCCS commands accept two types of arguments keyletters filenames
16
SCCS16 SCCS command admin initializes SCCS files, manipulates their descriptive text, and controls delta creation rights get retrieves versions of SCCS files unget undoes the effect of a get -e prior to the file being deltaed
17
SCCS17 SCCS command delta applies (changes) to SCCS files and creates new versions prs prints portions of an SCCS file in user specified format sact print information about the fils that are currently out for edit
18
SCCS18 SCCS command rmdel removes a delta from an SCCS file allows removal of deltas created by mistake cdc changes the commentary assocoated with a delta sccsdif shows differences between any two versions of an SCCS file
19
SCCS19 SCCS command what 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 comb combines consecutive deltas into one to reduce the size of an SCCS file Other can see in man pages of Unix.
20
SCCS20 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.
21
SCCS21 Initialize the history file with text from the indicated file. Create the history file called s.program.c in the SCCS subdirectory. Specify the release for the initial delta. The admin Command $ admin –ifile1.txt s.file1.txt $ create SCCS file1.txt $ admin –ifile1.txt –r3 s.file1.txt
22
SCCS22 The admin Command SCCS files contain a list of login names and/or group Ids of users who are allowed to create deltas. This list is empty by default, allowing anyone to create deltas. To create a user list (or add to an existing one), admin -a is used. For example $ admin -assupacho -avpreecha s.file1.txt
23
SCCS23 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. The retrieved file normally has the same filename base as the s.file, less the prefix, and is referred to as the g- file. retrieve a version of an SCCS file $ get s.file1.txt
24
SCCS24 The get Command ID keywords (Identification keywords) 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. This information appears in a load module when one is eventually created.
25
SCCS25 The get Command ID keywords (Identification keywords) ID keywords appearing anywhere in the generated file are replaced by appropriate values according to the definitions of those ID keywords
26
SCCS26 The get Command ID keywords (Identification keywords) 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.
27
SCCS27 The get Command Retrieve the version corresponding to the indicated SID (delta). Retrieve the version corresponding to the indicated SID (delta). $ get –r s.file1.txt Retrieve a version for editing Retrieve a version for editing $ get -e s.file1.txt Create a new branch. Create a new branch. $ get –b –e –r1.2 s.file1.txt
28
SCCS28 The get Command Retrieval With Intent to Make a Delta get -e indicates an intent to make a delta. First, get checks the following. 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.
29
SCCS29 The get Command Retrieval With Intent to Make a Delta 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.
30
SCCS30 The get Command Retrieval With Intent to Make a Delta The R is not locked against editing. The lock is a flag in the SCCS file. Whether multiple concurrent edits are allowed for the SCCS file by the j flag in the SCCS file.
31
SCCS31 The get Command Retrieval With Intent to Make a Delta A failure of any of the first three conditions causes the processing of the corresponding SCCS file to terminate. 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.
32
SCCS32 The get Command Retrieval With Intent to Make a Delta 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. get -e causes the creation (or updating) of a p.filename that is used to pass information to the delta command.
33
SCCS33 The get Command Retrieval With Intent to Make a Delta The p.filename prevents other users from retrieving the same version for editing until this one is checked in using delta or unget. Read only copied can be check out. Can use the -r option for different versions at the same time
34
SCCS34 The get Command Retrieval With Intent to Make a Delta 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.
35
SCCS35 Undoing a get -e 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.
36
SCCS36 The delta Command The delta command is used to incorporate changes made to a g- file into the corresponding SCCS file 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.
37
SCCS37 The delta Command 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. 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.
38
SCCS38 The delta Command $ ls -l total 2 -r--r--r-- 1 sbanyen ccstaff 513 Feb 18 10:24 s.file1.txt $ get -e s.file1.txt 1.2 new delta 1.3 4 lines
39
SCCS39 The delta Command $ ls -l total 6 -rw-r--r-- 1 sbanyen ccstaff 33 Feb 18 10:24 file1.txt -rw-r--r-- 1 sbanyen ccstaff 34 Feb 18 10:24 p.file1.txt -r--r--r-- 1 sbanyen ccstaff 513 Feb 18 10:24 s.file1.txt
40
SCCS40 The delta Command $ delta s.file1.txt comments? Add comment 1.3 1 inserted 1 deleted 3 unchanged
41
SCCS41 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.file1.txt will keep the g-file after processing.
42
SCCS42 The prs Command The prs command is used to print all or part of an SCCS file on the standard output. $ prs s.file1.txt D 1.1 01/02/17 20:44:50 sbanyen 1 0 00003/00000/00000 MRs:COMMENTS: date and time created 01/02/17 20:44:50 by sbanyen
43
SCCS43 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
44
SCCS44 The prs Command Example $ prs -d "File :M: version: :I: created: :D:" s.file1.txt File file1.txt version: 1.3 created: 01/02/18
45
SCCS45 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.file1.txt 1.3 1.4 sbanyen 01/02/18 12:23:38
46
SCCS46 The rmdel Command The rmdel command allows removal of a delta from an SCCS file. The delta to be removed must be leaf delta. The effective user must have write permission is the directory containing the SCCS file.
47
SCCS47 The rmdel Command 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. 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 -r1.3 s.file1.txt
48
SCCS48 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 -r1.2 s.file1.txt comments? Change number 3 to three word
49
SCCS49 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.
50
SCCS50 The what Command For example, if an SCCS file called s.file1.txt contains the following line: Filename is %W% and the command $ get s.file1.txt $ what file1.txt file1.txt: file1.txt 1.3 file1.txt 1.3
51
SCCS51 The what Command The string searched for by what need not be inserted via and ID keyword of get; if may be inserted in any convenient manner.
52
SCCS52 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.
53
SCCS53 The sccsdiff Command For example $ sccsdiff -r1.2 -r1.3 s.file1.txt 1c1 < %I% %M% --- > File name is %W%
54
SCCS54 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.
55
SCCS55 The comb Command Deltas 1.2, 1.3.2.1, 1.4 and 2.1 would be eliminate
56
SCCS56 Reference Karen S. Fortgang, UNIX System V (Programmer’s Guide), Prentice- Hall, Inc., Englewood Cliffs, NJ 07632, 1987. 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. [http://nacphy.physics.orst.edu/cop ying-with-unix/node169.html]
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.