home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / rcs57pc1.zip / doc / rcsintro.man < prev    next >
Text File  |  1996-02-13  |  12KB  |  331 lines

  1.  
  2.  
  3.  
  4. RCSINTRO(1)                                           RCSINTRO(1)
  5.  
  6.  
  7. NAME
  8.        rcsintro - introduction to RCS commands
  9.  
  10. DESCRIPTION
  11.        The  Revision  Control System (RCS) manages multiple revi-
  12.        sions of files.  RCS  automates  the  storing,  retrieval,
  13.        logging, identification, and merging of revisions.  RCS is
  14.        useful for text that is revised  frequently,  for  example
  15.        programs,  documentation,  graphics, papers, and form let-
  16.        ters.
  17.  
  18.        The basic user interface is extremely simple.  The  novice
  19.        only  needs  to  learn two commands: ci(1) and co(1).  ci,
  20.        short for "check in", deposits the contents of a file into
  21.        an archival file called an RCS file.  An RCS file contains
  22.        all revisions of a particular file.  co, short for  "check
  23.        out", retrieves revisions from an RCS file.
  24.  
  25.    Functions of RCS
  26.        o      Store and retrieve multiple revisions of text.  RCS
  27.               saves all old revisions in a space  efficient  way.
  28.               Changes no longer destroy the original, because the
  29.               previous revisions  remain  accessible.   Revisions
  30.               can  be  retrieved  according to ranges of revision
  31.               numbers,  symbolic  names,  dates,   authors,   and
  32.               states.
  33.  
  34.        o      Maintain  a  complete history of changes.  RCS logs
  35.               all changes automatically.   Besides  the  text  of
  36.               each  revision, RCS stores the author, the date and
  37.               time of check-in, and a log message summarizing the
  38.               change.  The logging makes it easy to find out what
  39.               happened to a module,  without  having  to  compare
  40.               source listings or having to track down colleagues.
  41.  
  42.        o      Resolve access conflicts.  When two  or  more  pro-
  43.               grammers  wish  to  modify  the  same revision, RCS
  44.               alerts the programmers and prevents  one  modifica-
  45.               tion from corrupting the other.
  46.  
  47.        o      Maintain  a  tree  of  revisions.  RCS can maintain
  48.               separate lines of development for each module.   It
  49.               stores  a tree structure that represents the ances-
  50.               tral relationships among revisions.
  51.  
  52.        o      Merge revisions and resolve conflicts.   Two  sepa-
  53.               rate  lines  of development of a module can be coa-
  54.               lesced by merging.  If the revisions to  be  merged
  55.               affect  the  same  sections of code, RCS alerts the
  56.               user about the overlapping changes.
  57.  
  58.        o      Control releases and configurations.  Revisions can
  59.               be  assigned symbolic names and marked as released,
  60.               stable, experimental, etc.  With these  facilities,
  61.  
  62.  
  63.  
  64. GNU                         1993/11/03                          1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. RCSINTRO(1)                                           RCSINTRO(1)
  71.  
  72.  
  73.               configurations  of  modules can be described simply
  74.               and directly.
  75.  
  76.        o      Automatically identify  each  revision  with  name,
  77.               revision  number,  creation time, author, etc.  The
  78.               identification is like a stamp that can be embedded
  79.               at  an appropriate place in the text of a revision.
  80.               The identification makes  it  simple  to  determine
  81.               which  revisions  of  which modules make up a given
  82.               configuration.
  83.  
  84.        o      Minimize secondary storage.  RCS needs little extra
  85.               space for the revisions (only the differences).  If
  86.               intermediate revisions are deleted, the correspond-
  87.               ing deltas are compressed accordingly.
  88.  
  89.    Getting Started with RCS
  90.        Suppose  you  have  a  file f.c that you wish to put under
  91.        control of RCS.  If you have not already done so, make  an
  92.        RCS directory with the command
  93.  
  94.               mkdir  RCS
  95.  
  96.        Then invoke the check-in command
  97.  
  98.               ci  f.c
  99.  
  100.        This  command  creates  an  RCS file in the RCS directory,
  101.        stores f.c into it as revision 1.1, and deletes  f.c.   It
  102.        also  asks  you for a description.  The description should
  103.        be a synopsis of the contents  of  the  file.   All  later
  104.        check-in  commands  will  ask  you  for a log entry, which
  105.        should summarize the changes that you made.
  106.  
  107.        Files in the RCS directory are called RCS files; the  oth-
  108.        ers  are  called  working  files.  To get back the working
  109.        file f.c in the previous example, use the  check-out  com-
  110.        mand
  111.  
  112.               co  f.c
  113.  
  114.        This  command  extracts  the  latest revision from the RCS
  115.        file and writes it into f.c.  If you want to edit f.c, you
  116.        must lock it as you check it out with the command
  117.  
  118.               co  -l  f.c
  119.  
  120.        You can now edit f.c.
  121.  
  122.        Suppose  after  some editing you want to know what changes
  123.        that you have made.  The command
  124.  
  125.               rcsdiff  f.c
  126.  
  127.  
  128.  
  129.  
  130. GNU                         1993/11/03                          2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. RCSINTRO(1)                                           RCSINTRO(1)
  137.  
  138.  
  139.        tells  you  the  difference  between  the  most   recently
  140.        checked-in  version  and  the working file.  You can check
  141.        the file back in by invoking
  142.  
  143.               ci  f.c
  144.  
  145.        This increments the revision number properly.
  146.  
  147.        If ci complains with the message
  148.  
  149.               ci error: no lock set by your name
  150.  
  151.        then you have tried to check in a file even though you did
  152.        not lock it when you checked it out.  Of course, it is too
  153.        late now to do the check-out with locking, because another
  154.        check-out  would  overwrite  your modifications.  Instead,
  155.        invoke
  156.  
  157.               rcs  -l  f.c
  158.  
  159.        This command will lock the latest revision for you, unless
  160.        somebody  else  got  ahead  of you already.  In this case,
  161.        you'll have to negotiate with that person.
  162.  
  163.        Locking assures that you, and only you, can check  in  the
  164.        next  update,  and avoids nasty problems if several people
  165.        work on the same file.  Even if a revision is  locked,  it
  166.        can still be checked out for reading, compiling, etc.  All
  167.        that locking prevents is a check-in  by  anybody  but  the
  168.        locker.
  169.  
  170.        If  your  RCS  file  is private, i.e., if you are the only
  171.        person who is going to deposit revisions into  it,  strict
  172.        locking  is not needed and you can turn it off.  If strict
  173.        locking is turned off, the owner of the RCS file need  not
  174.        have  a  lock  for check-in; all others still do.  Turning
  175.        strict locking off and on is done with the commands
  176.  
  177.               rcs  -U  f.c     and     rcs  -L  f.c
  178.  
  179.        If you don't want to clutter your working  directory  with
  180.        RCS  files, create a subdirectory called RCS in your work-
  181.        ing directory, and move all your  RCS  files  there.   RCS
  182.        commands  will  look  first  into  that  directory to find
  183.        needed files.  All the commands discussed above will still
  184.        work,  without  any modification.  (Actually, pairs of RCS
  185.        and working files can be specified in three ways: (a) both
  186.        are  given,  (b)  only the working file is given, (c) only
  187.        the RCS file is given.  Both RCS  and  working  files  may
  188.        have  arbitrary  path  prefixes; RCS commands pair them up
  189.        intelligently.)
  190.  
  191.        To avoid the deletion of the working file during  check-in
  192.        (in  case  you  want  to  continue  editing or compiling),
  193.  
  194.  
  195.  
  196. GNU                         1993/11/03                          3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. RCSINTRO(1)                                           RCSINTRO(1)
  203.  
  204.  
  205.        invoke
  206.  
  207.               ci  -l  f.c     or     ci  -u  f.c
  208.  
  209.        These commands check in  f.c  as  usual,  but  perform  an
  210.        implicit check-out.  The first form also locks the checked
  211.        in revision, the second one doesn't.  Thus, these  options
  212.        save  you one check-out operation.  The first form is use-
  213.        ful if you want to continue editing, the second one if you
  214.        just  want  to read the file.  Both update the identifica-
  215.        tion markers in your working file (see below).
  216.  
  217.        You can give ci the number you want assigned to a  checked
  218.        in revision.  Assume all your revisions were numbered 1.1,
  219.        1.2, 1.3, etc., and you would like  to  start  release  2.
  220.        The command
  221.  
  222.               ci  -r2  f.c     or     ci  -r2.1  f.c
  223.  
  224.        assigns the number 2.1 to the new revision.  From then on,
  225.        ci will number the subsequent  revisions  with  2.2,  2.3,
  226.        etc.  The corresponding co commands
  227.  
  228.               co  -r2  f.c     and     co  -r2.1  f.c
  229.  
  230.        retrieve the latest revision numbered 2.x and the revision
  231.        2.1, respectively.  co without a revision  number  selects
  232.        the  latest  revision on the trunk, i.e. the highest revi-
  233.        sion with a number consisting of two fields.  Numbers with
  234.        more  than  two fields are needed for branches.  For exam-
  235.        ple, to start a branch at revision 1.3, invoke
  236.  
  237.               ci  -r1.3.1  f.c
  238.  
  239.        This command starts a branch numbered 1 at  revision  1.3,
  240.        and  assigns  the number 1.3.1.1 to the new revision.  For
  241.        more information about branches, see rcsfile(5).
  242.  
  243.    Automatic Identification
  244.        RCS can put special strings for identification  into  your
  245.        source  and  object  code.  To obtain such identification,
  246.        place the marker
  247.  
  248.               $Id$
  249.  
  250.        into your text, for instance inside a comment.   RCS  will
  251.        replace this marker with a string of the form
  252.  
  253.               $Id:  filename  revision  date  time  author  state
  254.               $
  255.  
  256.        With such a marker on the first page of each  module,  you
  257.        can  always  see with which revision you are working.  RCS
  258.        keeps the markers up to date automatically.  To  propagate
  259.  
  260.  
  261.  
  262. GNU                         1993/11/03                          4
  263.  
  264.  
  265.  
  266.  
  267.  
  268. RCSINTRO(1)                                           RCSINTRO(1)
  269.  
  270.  
  271.        the  markers  into  your object code, simply put them into
  272.        literal character strings.  In C, this is done as follows:
  273.  
  274.               static char rcsid[] = "$Id$";
  275.  
  276.        The  command  ident  extracts  such markers from any file,
  277.        even object code and dumps.  Thus, ident lets you find out
  278.        which revisions of which modules were used in a given pro-
  279.        gram.
  280.  
  281.        You may also find it useful to put the marker  $Log$  into
  282.        your  text, inside a comment.  This marker accumulates the
  283.        log messages that are requested  during  check-in.   Thus,
  284.        you  can  maintain  the  complete  history  of  your  file
  285.        directly inside it.  There are several additional  identi-
  286.        fication markers; see co(1) for details.
  287.  
  288. IDENTIFICATION
  289.        Author: Walter F. Tichy.
  290.        Manual Page Revision: 5.3; Release Date: 1993/11/03.
  291.        Copyright (C) 1982, 1988, 1989 Walter F. Tichy.
  292.        Copyright (C) 1990, 1991, 1992, 1993 Paul Eggert.
  293.  
  294. SEE ALSO
  295.        ci(1),  co(1),  ident(1), rcs(1), rcsdiff(1), rcsintro(1),
  296.        rcsmerge(1), rlog(1)
  297.        Walter  F.  Tichy,  RCS--A  System  for  Version  Control,
  298.        Software--Practice   &   Experience  15,  7  (July  1985),
  299.        637-654.
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328. GNU                         1993/11/03                          5
  329.  
  330.  
  331.