Functionally RCS and SCCS (up to revision ) are similar, with SCCS now having RCS uses fewer intermediate files while applying a delta to a history file . Reviewer: John R. Levine. SCCS and RCS are two classic sets of Unix tools. They both do the same thing, namely, track changes to text files by keeping. A version control file contains the original file (called a g-file in SCCS) together with all the changes, or deltas, that have been applied to it. Each delta is.
|Genre:||Health and Food|
|Published (Last):||28 March 2011|
|PDF File Size:||10.83 Mb|
|ePub File Size:||9.52 Mb|
|Price:||Free* [*Free Regsitration Required]|
Tichy at Purdue University in the early s. In this chapter we present the most basic capabilities of RCS, by showing how you can apply it to the source file modification cycle.
If RCS is of interest to you, make sure your system provides it.
6 Revision Control: Managing Source Files with RCS or SCCS
If not, you’ll be obliged to obtain it from another source, such as the FSF. We provide instructions for doing so in Appendix H, References. RCE is built atop a difference generator that works between arbitrary files, and is implemented as a library, permitting source control operations to be integrated with existing applications. A “stand-alone” command-line interface that is compatible with RCS is provided, as well as a applyingg interface.
We have not evaluated RCE; if it’s of interest to you, see Appendix H for information on finding out more about it. In this book we describe RCS version 5. Since the new support is incomplete, it’s disabled, making 5. Though it changes nothing fundamental, 5. We flag the most important or visible of these in footnotes at the relevant points in our presentation.
In the current release, the command is implemented in C and uses much of the same internal code as the other RCS commands. Though the RCS sources still flag rcsclean as experimental, we think it’s “grown up” enough to warrant inclusion as part of the standard system. Before describing the basic RCS commands, let’s define some terms and take a look at command-line conventions, especially how you specify files to the system.
When RCS creates an archive file, the name of the archive file is the source file name with ,v appended to it. Thus if you created an archive for the file xform.
The ” ,v ” nominally refers to the multiple “versions” of the source file stored in the archive file. All of scccs terms that we introduced in prior chapters to talk about source control in fact come from RCS. Thus RCS uses the term “revision” to refer to each stored version of the source file. It also uses the term “check-in” to refer to the addition of a new revision to an RCS file and “check-out” to refer to the retrieval of an existing revision from an RCS rce.
And a source file that’s been retrieved from an RCS file is known as a “working file.
Applying RCS and SCCS – O’Reilly Media
Like most programs with a UNIX heritage, all RCS commands expect a command line that consists of a command name followed by one or more file names. The file names may be but don’t have to be preceded by one or more options. If given, options change how the command works. So to summarize, a command line looks like. Each option begins with a hyphen, which is what distinguishes it from a filename. After the hyphen comes a single letter that identifies the option; then for some options comes a string that serves as a value for the option.
Never insert whitespace between an option letter and its value–let them appear as one argument on the command line.
The first argument not starting with a hyphen is assumed to begin the filename arguments for the command. Each file named on a command line can be gcs a source file or an RCS file, as we explain below.
This invocation of the rcsdiff 1 command specifies one option -rwhich has 1. One final note is really not related to RCS, but to entering quoted strings on a shell command line. As we’ll see, you sometimes have the choice of entering a description of an operation either at a prompt from sdcs program you’re running or directly on the program’s command line.
If you want to give the description on the command line, you’ll need to enter it as a quoted string because it will contain whitespace. And if you want to continue the description over more than one line, you’ll have to use whatever convention your shell supports for continuing a command line.
For example, the -m option to the ci program specifies comments for a check-in operation. If you want to give a multiline comment and you’re using csh 1 or derivatives as your shell, you need to precede each carriage return in the commentary with a backslash:.
However, under the Bourne shell or ksh 1 or bash 1as long as the value for -m is quoted, you don’t need to do anything special to continue the comments onto a second line:. In running an RCS command, you can name either a working file or the corresponding RCS file on the command line; the command will automatically derive the other file name from the one you provide. This means, for instance, that these two command lines are equivalent:. If you create such a subdirectory beneath the directory where you’re working, RCS will try to use it before trying to use the current directory.
RCS will not, however, create a subdirectory if one doesn’t already exist.
Let’s examine naming in more detail. Say that your working file has the name workfile and that path1 and path2 are UNIX pathnames. Then the full set of rules for ap;lying names to an RCS command looks like applyign. Naturally, this is also what happens in the simple case in which anr is not present. If you name only an RCS file without a pathname prefix such as workfile,vthe command tries to use workfile,v first in any RCS subdirectory beneath the current directory, then in the current directory itself.
If it can use an RCS file with one of those names, it tries to use a working file named workfile in the current directory. Then it tries to use a working file named workfile in the current directory.
If you name both a working file and an RCS file, then the command uses files with exactly those names during its execution. In this case the two files can be specified in either order, and can come from completely unrelated applyinb. Suppose, for instance, that in your current directory you had a source file xform.
The command here is the “check-in” command we describe below. When the source file applyimg the RCS file are in the same directory or when the RCS file is in an RCS subdirectorythere’s no need to give both file names on the command line.
This becomes useful only if the two files are in unrelated directories.
For example, if xform. Command lines like this one become useful when you put files into separate trees according to their type. This is one of the key concepts behind project control, as we’ll see time and again in later chapters.
If you take this approach, though, you won’t want to be typing horrendously long command lines all the time. It’s far better to create some kind of “tree mapper” to manage the filenames for you.
Such a mapper is fundamental to systems like TCCS. Naturally, for any RCS command, you can specify more than one file, and the command will process each file in turn. For your own sake, if you frequently process more than one file at a time, you’ll probably want to use an RCS subdirectory to hold RCS files. This helps you avoid naming RCS files by mistake when you use wildcards to name groups of working files.
PDF Applying RCS and SCCS: From Source Control to Project Control (Nutshell Handbooks) Don
Note that RCS will take a command line of intermixed working filenames and RCS filenames and match them up using the rules we outlined earlier in this chapter. Though this may work all right for simple cases, however, the potential for ambiguity or erroneous file inclusion is great enough that you should avoid the situation altogether and just segregate your RCS files in an RCS subdirectory.
This is desirable for more general administrative reasons as well. Working files and RCS files are innately different, and it only makes sense to keep them in distinct places to make it easy to administer them appropriately. In particular, by segregating your RCS files, you make it harder to access them accidentally in any way other than through the RCS command set.
An rm -rf will still remove them, of course, but the added safety of an RCS subdirectory shouldn’t be neglected. Now we present one iteration of the source file modification cycle, using RCS commands to implement each operation. We also cover a few other basic commands that are not strictly part of the cycle.
All of this involves only some of the RCS commands and few if any of their many options. Later chapters explore more of the potential of the full RCS command set. This is the same picture we presented as Figurebut with the “bubbles” annotated to show which RCS command actually implements each operation. So once again, the central part of the figure shows the modification cycle.
Let’s cover each of the operations in more depth. Roughly speaking, we’ll describe them in the order in which they appear in the figure, working from top to bottom. You create an RCS file with the command ci 1 for “check-in”. The command line need not specify anything but the name of the source file you’re checking in. So a simple example of creating an RCS file is.
If you’ve already made an RCS subdirectory, then the file will be created there. Otherwise, it will be created in the current directory. By default, when you create an RCS file, you’re prompted for a short description of the file you’re putting under source control. You may enter as much text as you like in response, ending your input with a line containing a period by itself. The interaction looks like this:.
Once the RCS file is created, your source file is immediately deleted. It is, of course, now safely stored in the RCS file and can be extracted as a working file whenever you want it.
As the warning “NOTE: This is NOT the log message! The first description, which is what ane prompts for by default, is for the file itself–this message is meant to describe the role of the file in your project.
Andd addition, ci also creates a log message a term we’ll come back to laterto describe the first revision of the archive file–you can use this description to trace the origins of the source file you’re checking in. By default, ci creates a log message with the value “Initial revision”.
If you want to use the message actually to capture some useful data, you can use the -m option on the ci command line to specify it, like this:. Of course, this message has to be quoted, and the usual rules apply if it extends across multiple lines. The ci command also lets you specify the archive file description on the command line, instead of being prompted for it, via the -t flag.
Scca fact, you can use -t on any check-in, not just the first one, to change an archive’s description. You can give a description either as the value to -t or in apllying file, which you name using -t.