From: pds@lemming.webo.dg.com (Paul D. Smith)
Subject: Re: RCS usage
Date: 10 Dec 92 22:38:36 GMT
To: tk@dcs.ed.ac.uk (Tommy Kelly), ajw.dcs.ed.ac.uk (Amanda Welsh)
Organization: NSDD/ONSD, Data General Corp., Westboro, MA

[] Regarding RCS usage;
[] tk@dcs.ed.ac.uk (Tommy Kelly) writes:

    tk> Suppose I have five source files, A, B, C, D and E which make
    tk> up an application.  As I develop the application, I want to
    tk> keep track of which revisions of each file combine to create a
    tk> particular version of my application.

    tk> At the moment I am keeping a shellscript also under RCS which
    tk> checks out all required revisions (along with relevant README,
    tk> Makefile, etc).  I update that shellscript each time I am
    tk> satisfied with a new version.  Every time I want a particular
    tk> version of my application, I check out that revision of my
    tk> shellscript and run it.

    tk> Question: Is there an easier way to do this, perhaps using RCS
    tk> itself?

These are the kinds of things one uses source control *for*, so you
don't need to do all that mess.

There are at *least* two easy ways to do this.

(a) The most obvious and natural is to update the RCS major revision
    each time you create a version you want to keep track of.

    So after you get to a certain point you decide you're done with
    this "version", which has RCS major rev 1 (files have versions
    like 1.1, 1.2, 1.3, etc.), co -l all your files, then
    use something like:

        ci -f -m"Updating to new vesion 2.0" -r2 <files>

    This will check in all your files with a new major rev number,
    starting with 2.1, then 2.2, etc.

    If you want the "version 1" files back, just say:

        co -r1 <files>

    Note that if you don't give a minor version number, RCS
    automatically substitutes the latest rev.  So that checks out the
    last version of each file in <files> with major revision 1.

    This is definitely the best way to keep track of "major stopping
    points", like versions released to others.

(b) Better for "your own information" version numbers, where you just
    might want to get back these files but it's not a "real" stopping
    point, is to name each revision: just say:

        rcs -nMY_REV:1 <files>

    This will associate the symbolic name MY_REV with the latest
    version of major revision 1 in each file in <files>.

    MY_REV can be used in place of any revision on any RCS command, so
    you could then say:

        co -rMY_REV <files>

    To get all the files so marked.

You should really spend some time reading the ci(1), co(1), and rcs(1)
man pages and familiarize yourself with the features of RCS.  They are
many and powerful :)
--

                                                                paul
-----
 ------------------------------------------------------------------
| Paul D. Smith                          |    paul_smith@dg.com    |
| Data General Corp.                     | pds@lemming.webo.dg.com |
| Network Systems Development Division   |                         |
| Open Network Systems Development       |   "Pretty Damn S..."    |
 ------------------------------------------------------------------
Newsgroups: comp.unix.questions,comp.unix.aix