NAME
rcsintro - introduction to RCS commands
DESCRIPTION
The Revision Control System (RCS) manages multiple revisions of files. RCS automates the storing, retrieval, logging, identification, andmerging of revisions. RCS is useful for text that is revised fre-
quently, for example programs, documentation, graphics, papers, and form letters. The basic user interface is extremely simple. The novice only needs to learn two commands: ccii(1) and ccoo(1). ccii, short for "check in", deposits the contents of a file into an archival file called an RCS file. An RCS file contains all revisions of a particular file. ccoo, short for "check out", retrieves revisions from an RCS file. FFuunnccttiioonnss ooff RRCCSS +o Store and retrieve multiple revisions of text. RCS saves all old revisions in a space efficient way. Changes no longer destroy the original, because the previous revisions remain accessible. Revisions can be retrieved according to ranges of revision numbers, symbolic names, dates, authors, and states. +o Maintain a complete history of changes. RCS logs all changes automatically. Besides the text of each revision, RCS storesthe author, the date and time of check-in, and a log message
summarizing the change. The logging makes it easy to find out what happened to a module, without having to compare source listings or having to track down colleagues. +o Resolve access conflicts. When two or more programmers wish tomodify the same revision, RCS alerts the programmers and pre-
vents one modification from corrupting the other. +o Maintain a tree of revisions. RCS can maintain separate lines of development for each module. It stores a tree structure that represents the ancestral relationships among revisions. +o Merge revisions and resolve conflicts. Two separate lines of development of a module can be coalesced by merging. If the revisions to be merged affect the same sections of code, RCS alerts the user about the overlapping changes. +o Control releases and configurations. Revisions can be assigned symbolic names and marked as released, stable, experimental, etc. With these facilities, configurations of modules can be described simply and directly. +o Automatically identify each revision with name, revision number, creation time, author, etc. The identification is like a stamp that can be embedded at an appropriate place in the text of a revision. The identification makes it simple to determine which revisions of which modules make up a given configuration. +o Minimize secondary storage. RCS needs little extra space for the revisions (only the differences). If intermediate revisionsare deleted, the corresponding deltas are compressed accord-
ingly. GGeettttiinngg SSttaarrtteedd wwiitthh RRCCSS Suppose you have a file ff..cc that you wish to put under control of RCS. If you have not already done so, make an RCS directory with the command mmkkddiirr RRCCSSThen invoke the check-in command
ccii ff..cc This command creates an RCS file in the RRCCSS directory, stores ff..cc intoit as revision 1.1, and deletes ff..cc. It also asks you for a descrip-
tion. The description should be a synopsis of the contents of thefile. All later check-in commands will ask you for a log entry, which
should summarize the changes that you made. Files in the RCS directory are called RCS files; the others are calledworking files. To get back the working file ff..cc in the previous exam-
ple, use the check-out command
ccoo ff..cc This command extracts the latest revision from the RCS file and writes it into ff..cc. If you want to edit ff..cc, you must lock it as you check it out with the commandccoo -ll ff..cc
You can now edit ff..cc. Suppose after some editing you want to know what changes that you have made. The command rrccssddiiffff ff..cctells you the difference between the most recently checked-in version
and the working file. You can check the file back in by invoking ccii ff..cc This increments the revision number properly. If ccii complains with the message ccii eerrrroorr:: nnoo lloocckk sseett bbyy your name then you have tried to check in a file even though you did not lock it when you checked it out. Of course, it is too late now to do thecheck-out with locking, because another check-out would overwrite your
modifications. Instead, invokerrccss -ll ff..cc
This command will lock the latest revision for you, unless somebody else got ahead of you already. In this case, you'll have to negotiate with that person. Locking assures that you, and only you, can check in the next update, and avoids nasty problems if several people work on the same file. Even if a revision is locked, it can still be checked out for reading,compiling, etc. All that locking prevents is a check-in by anybody but
the locker. If your RCS file is private, i.e., if you are the only person who is going to deposit revisions into it, strict locking is not needed and you can turn it off. If strict locking is turned off, the owner of theRCS file need not have a lock for check-in; all others still do. Turn-
ing strict locking off and on is done with the commandsrrccss -UU ff..cc and rrccss -LL ff..cc
If you don't want to clutter your working directory with RCS files, create a subdirectory called RRCCSS in your working directory, and move all your RCS files there. RCS commands will look first into that directory to find needed files. All the commands discussed above will still work, without any modification. (Actually, pairs of RCS and working files can be specified in three ways: (a) both are given, (b) only the working file is given, (c) only the RCS file is given. Both RCS and working files may have arbitrary path prefixes; RCS commands pair them up intelligently.)To avoid the deletion of the working file during check-in (in case you
want to continue editing or compiling), invokeccii -ll ff..cc or ccii -uu ff..cc
These commands check in ff..cc as usual, but perform an implicit check-
out. The first form also locks the checked in revision, the second onedoesn't. Thus, these options save you one check-out operation. The
first form is useful if you want to continue editing, the second one if you just want to read the file. Both update the identification markers in your working file (see below). You can give ccii the number you want assigned to a checked in revision. Assume all your revisions were numbered 1.1, 1.2, 1.3, etc., and you would like to start release 2. The commandccii -rr22 ff..cc or ccii -rr22..11 ff..cc
assigns the number 2.1 to the new revision. From then on, ccii will num-
ber the subsequent revisions with 2.2, 2.3, etc. The corresponding ccoo commandsccoo -rr22 ff..cc and ccoo -rr22..11 ff..cc
retrieve the latest revision numbered 2.x and the revision 2.1, respec-
tively. ccoo without a revision number selects the latest revision on the trunk, i.e. the highest revision with a number consisting of two fields. Numbers with more than two fields are needed for branches. For example, to start a branch at revision 1.3, invokeccii -rr11..33..11 ff..cc
This command starts a branch numbered 1 at revision 1.3, and assigns the number 1.3.1.1 to the new revision. For more information about branches, see rrccssffiillee(5). AAuuttoommaattiicc IIddeennttiiffiiccaattiioonn RCS can put special strings for identification into your source and object code. To obtain such identification, place the marker$$IIdd$$
into your text, for instance inside a comment. RCS will replace this marker with a string of the form$$IIdd:: filename revision date time author state $$
With such a marker on the first page of each module, you can always see with which revision you are working. RCS keeps the markers up to date automatically. To propagate the markers into your object code, simplyput them into literal character strings. In C, this is done as fol-
lows:ssttaattiicc cchhaarr rrccssiidd[[]] == ""$$IIdd$$"";;
The command iiddeenntt extracts such markers from any file, even object codeand dumps. Thus, iiddeenntt lets you find out which revisions of which mod-
ules were used in a given program.You may also find it useful to put the marker $$LLoogg$$ into your text,
inside a comment. This marker accumulates the log messages that arerequested during check-in. Thus, you can maintain the complete history
of your file directly inside it. There are several additional identi-
fication markers; see ccoo(1) for details. IIDDEENNTTIIFFIICCAATTIIOONN Author: Walter F. Tichy. Manual Page Revision: 1.1; Release Date: 1999/04/23. Copyright (C) 1982, 1988, 1989 Walter F. Tichy. Copyright (C) 1990, 1991, 1992, 1993 Paul Eggert.SEE ALSO
ci(1), co(1), ident(1), rcs(1), rcsdiff(1), rcsintro(1), rcsmerge(1),
rlog(1)Walter F. Tichy, RCS-A System for Version Control, Software-Practice
& Experience 1155, 7 (July 1985), 637-654.
GNU 1999/04/23 RCSINTRO(1)