Resource Control System for Integral PC The Integral PC's HP-UX Tools set is shipped with a set of utilities known collectively as SCCS (Source Code Control System), which allows a professional programmer or writer to keep a trail of revisions of ASCII text files (like program source code or technical manuals.) SCCS has been around a long time (rumor has it that it was derived from a set of programs that ran on IBM mainframes in the late sixties), and there is a cleaner, faster, and more modern system available: the Resource Control System, or RCS. RCS was developed by Walter Tichy of Purdue in the late seventies; HP has rights to distribute RCS program code to UNIX (tm) users - and so RCS is now available for the Integral PC. RCS is conceptually easy to grasp and is just as easy to use; the programmer who gave it to me showed me how to use it in a matter of minutes. RCS is built around a core of three utility programs: * rcs - Creates and controls an RCS archive file. * ci - Checks a file into the RCS archive file. * co - Checks a file out of the RCS archive file. If this seems obscure - no, not really. The "rcs" utility can be used to create an RCS archive file, which acts as a computerized "library" where revisions of a document are stored in (what appears to be) consecutive order. (Actually, the archive stores only the current edition of the document as a whole; earlier revisions exist as sets of changes to the current document ... but from the user's point of view, that hardly makes much difference.) The "check in" utility, "ci", allows the user to check a new revision of the document file into the RCS archive. The invisible "librarian" that controls the archive places the document in its proper place in the sequence of revisions, and adds logging information and comments (if specified) to the new revision. The "check out" utiltiy, "co", allows the user to ask the invisible "librarian" for one of the revisions in the archive. By default, the "librarian" will produce the latest revision, but the librarian can easily be asked to provide any other revision in the sequence. These are the most essential - and commonly-used - capabilities of RCS, but the "librarian" that runs the archive is fairly smart, and can do more sophisticated things. RCS can track separate lines of evolution for a document - consider a program that evolves into three different new programs; RCS can track all three in a single archive. Similarly, RCS can merge separate lines of evolution of a document back into a single line - if the documents have not diverged to the point where attempts to do so cause violent conflicts. (RCS can still merge the files, but the results may not be particularly useful.) RCS can also perform searches of the archive, with the search key based on such characteristics as author of the revision, date of revision, and so on. RCS can provide a listing of the files in the archive and provide information about each; find differences between files within the archive and between a file within the archive and one NOT in the archive; and perform many other functions. Like I said, RCS is easy to use; the following example will show just how easy to use it is. I started out with a simple file: $Log$ This is the first revision of this text. I named this file "gvg.c" (I always like a little personal touch in my work). Notice one little subtlety, though: the string $Log$ in the first line. RCS recognizes this string and places logging information in it, adding to it every time a new revision is placed in the archive. I stored the file in "/", and created the archive for it as follows: rcs -U -i gvg.c This created the archive file for "gvg.c", which was named "gvg.c,v"; RCS uses the ",v" suffix to designate an RCS archive. This archive was also placed in "/", but I could've specified any other directory as well. RCS also allows the user to create a "default" directory, named "RCS"; if "RCS" is created as a subdirectory to the directory that RCS commands will be called from, then (if RCS isn't told to do otherwise) all archives will be created and stored within the "RCS" subdirectory. I then checked the document file into the archive as follows: ci -u gvg.c The "-u" option specified that the document file was to be checked out of the archive again, immediately after having been checked in; that left me with a working copy of the file - which, incidentally, contained the logging information RCS had inserted into the file: $Log: gvg.c,v $ * Revision 1.1 86/11/19 18:37:33 18:37:33 ipc (ipc user) * Initial revision * This is the first revision of this text. I then revised this file by changing the word "first" to the word "second", and then archived the revision, just as I had archived the original. However - THIS time, "ci" asked me for some comment that it could put in the log header. (Apparently this step is not regarded as necessary when a new document is being placed by "ci" into an empty archive.) I entered: Onward and upward ... The revised document file, after having been archived and spat out again by RCS, looked like: $Log: gvg.c,v $ * Revision 1.2 86/11/19 18:41:32 18:41:32 ipc (ipc user) * Onward and upward ... * * Revision 1.1 86/11/19 18:37:33 18:37:33 ipc (ipc user) * Initial revision * This is the second revision of this text. I then changed the document again, by exchanging the word "third" for the word "second", and archived it as before, this time providing the comment: ... to bigger and better things. The result was: $Log: gvg.c,v $ * Revision 1.3 86/11/19 18:50:51 18:50:51 ipc (ipc user) * ... to bigger and better things. * * Revision 1.2 86/11/19 18:41:32 18:41:32 ipc (ipc user) * Onward and upward ... * * Revision 1.1 86/11/19 18:37:33 18:37:33 ipc (ipc user) * Initial revision * This is the third revision of this text. This was beginning to get tiresome, so I decided to call it quits and retrieve a previous revision of "gvg.c"; I settled on revision 1.2. I entered the command: co -r1.2 gvg.c - and ended up with the previous version of the file. Easy, right? A full discussion of RCS is far "beyond the scope of this document", as the saying goes, but I will point out there are a few other utility programs in the RCS package, besides the three I have already shown you: * ident: Searches the archive for files with particular characteristics. * rlog: Provides an information dump about the files in an archive. * rcsdiff: Provides a list of differences of two archive files. * rcsmerge: Allows changes between two revisions of archived files to be incorporated into a non-archived file. * merge: Similar to "rcsmerge", but works with non-archived files.