home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / rcs / rcs.doc < prev    next >
Text File  |  1992-01-20  |  57KB  |  1,191 lines

  1.              RCS--A System for Version Control
  2.  
  3.  
  4.                       Walter F. Tichy
  5.  
  6.               Department of Computer Sciences
  7.                      Purdue University
  8.                West Lafayette, Indiana 47907
  9.  
  10.  
  11.                           ABSTRACT
  12.  
  13.           An important problem in  program  development
  14.      and maintenance is version control, i.e., the task
  15.      of keeping a software system  consisting  of  many
  16.      versions  and  configurations well organized.  The
  17.      Revision Control System (RCS) is a  software  tool
  18.      that  assists  with  that task.  RCS manages revi-
  19.      sions of text documents, in particular source pro-
  20.      grams, documentation, and test data.  It automates
  21.      the storing, retrieval, logging and identification
  22.      of revisions, and it provides selection mechanisms
  23.      for composing configurations.  This  paper  intro-
  24.      duces basic version control concepts and discusses
  25.      the practice of version control  using  RCS.   For
  26.      conserving space, RCS stores deltas, i.e., differ-
  27.      ences between successive revisions.  Several delta
  28.      storage  methods  are discussed.  Usage statistics
  29.      show that RCS's delta storage method is space  and
  30.      time   efficient.   The  paper  concludes  with  a
  31.      detailed survey of version control tools.
  32.  
  33.      Keywords:   configuration   management,    history
  34.      management, version control, revisions, deltas.
  35.  
  36.      1991/01/03
  37.  
  38.  
  39. 1.   Introduction
  40.  
  41.      Version control is the task of keeping software systems
  42. consisting  of  many versions and configurations well organ-
  43. ized.  The Revision Control System (RCS) is a  set  of  UNIX
  44. commands that assist with that task.
  45.  
  46.      RCS' primary function is to manage revision groups.   A
  47. revision group is a set of text documents, called revisions,
  48. that evolved from each other.  A new revision is created  by
  49. manually  editing  an existing one.  RCS organizes the revi-
  50. sions into an ancestral tree.  The initial revision  is  the
  51. root  of  the  tree,  and the tree edges indicate from which
  52. revision a given one evolved.  Besides  managing  individual
  53. revision  groups,  RCS provides flexible selection functions
  54. for composing configurations.   RCS  may  be  combined  with
  55. MAKE1, resulting in a powerful package for version control.
  56.  
  57.      RCS also offers facilities  for  merging  updates  with
  58. customer  modifications,  for  distributed software develop-
  59. ment, and for automatic identification.   Identification  is
  60. the  `stamping'  of revisions and configurations with unique
  61. markers.  These markers are akin to serial numbers,  telling
  62. software  maintainers  unambiguously  which configuration is
  63. before them.
  64.  
  65.      RCS is designed for both  production  and  experimental
  66. environments.   In  production environments, access controls
  67. detect update conflicts and prevent overlapping changes.  In
  68. experimental  environments,  where strong controls are coun-
  69. terproductive, it is possible to loosen the controls.
  70.  
  71.      Although RCS was originally intended for  programs,  it
  72. is  useful for any text that is revised frequently and whose
  73. previous revisions must be preserved.  RCS has been  applied
  74. successfully  to  store  the  source text for drawings, VLSI
  75. layouts,  documentation,  specifications,  test  data,  form
  76. letters and articles.
  77.  
  78.      This paper discusses the practice  of  version  control
  79. using  RCS.   It  also introduces basic version control con-
  80. cepts, useful for clarifying current practice and  designing
  81. similar  systems.   Revision groups of individual components
  82. are treated in the next three sections, and  the  extensions
  83. to  configurations follow.  Because of its size, a survey of
  84. version control tools appears at the end of the paper.
  85.  
  86. 2.   Getting started with RCS
  87.  
  88.      Suppose a text file f.c is to be placed  under  control
  89. of RCS.  Invoking the check-in command
  90.  
  91.      ci  f.c
  92.  
  93. creates a new revision group with the contents of f.c as the
  94. initial  revision  (numbered  1.1) and stores the group into
  95. the file f.c,v.  Unless told otherwise, the command  deletes
  96. f.c.   It  also  asks  for  a description of the group.  The
  97. description should state the common purpose of all revisions
  98. in the group, and becomes part of the group's documentation.
  99. All later check-in commands will ask for a log entry,  which
  100. should  summarize  the changes made.  (The first revision is
  101. assigned a default log message, which just records the  fact
  102. that it is the initial revision.)
  103.  
  104.      Files ending in ,v are called RCS files (v  stands  for
  105. versions); the others are called working files.  To get back
  106. the working file f.c in the previous  example,  execute  the
  107. check-out command:
  108.  
  109.      co  f.c
  110.  
  111. This command extracts the latest revision from the  revision
  112. group f.c,v and writes it into f.c.  The file f.c can now be
  113. edited and, when finished, checked back in with ci:
  114.  
  115.      ci  f.c
  116.  
  117. Ci assigns number 1.2 to the new revision.  If ci  complains
  118. with the message
  119.  
  120.      ci error: no lock set by <login>
  121.  
  122. then the system administrator has decided to  configure  RCS
  123. for a production environment by enabling the `strict locking
  124. feature'.  If this feature is enabled,  all  RCS  files  are
  125. initialized  such that check-in operations require a lock on
  126. the previous revision (the one from which  the  current  one
  127. evolved).   Locking  prevents  overlapping  modifications if
  128. several people  work  on  the  same  file.   If  locking  is
  129. required,  the  revision  should have been locked during the
  130. check-out by using the option -l:
  131.  
  132.      co  -l  f.c
  133.  
  134. Of course it is too late now for the check-out with locking,
  135. because  f.c has already been changed; checking out the file
  136. again  would  overwrite  the  modifications.   (To   prevent
  137. accidental  overwrites,  co senses the presence of a working
  138. file and asks whether the user really intended to  overwrite
  139. it.  The overwriting check-out is sometimes useful for back-
  140. ing up to the previous revision.) To be able to proceed with
  141. the check-in in the present case, first execute
  142.  
  143.      rcs  -l  f.c
  144.  
  145. This command retroactively locks the latest revision, unless
  146. someone  else  locked it in the meantime.  In this case, the
  147. two programmers involved have to negotiate  whose  modifica-
  148. tions should take precedence.
  149.  
  150.      If an RCS file is private, i.e., if only the  owner  of
  151. the  file  is  expected  to  deposit  revisions into it, the
  152. strict locking feature is unnecessary and may  be  disabled.
  153. If  strict  locking  is  disabled, the owner of the RCS file
  154. need not have a lock for check-in.  For safety reasons,  all
  155. others  still do.  Turning strict locking off and on is done
  156. with the commands:
  157.  
  158.      rcs  -U  f.c       and         rcs  -L  f.c
  159.  
  160. These commands enable or disable the strict locking  feature
  161. for  each  RCS  file individually.  The system administrator
  162. only decides whether strict locking is enabled initially.
  163.  
  164.      To reduce the clutter in a working directory,  all  RCS
  165. files can be moved to a subdirectory with the name RCS.  RCS
  166. commands look first into that directory for RCS files.   All
  167. the  commands presented above work with the RCS subdirectory
  168. without change.-
  169.  
  170.      It may be undesirable that ci deletes the working file.
  171. For  instance,  sometimes one would like to save the current
  172. revision, but continue editing.  Invoking
  173.  
  174.      ci  -l  f.c
  175.  
  176. checks in f.c as usual, but performs an additional check-out
  177. with  locking  afterwards.   Thus, the working file does not
  178. disappear after the check-in.  Similarly, the option -u does
  179. a  check-in  followed  by a check-out without locking.  This
  180. option is useful if the file is needed for compilation after
  181. the  check-in.  Both options update the identification mark-
  182. ers in the working file (see below).
  183.  
  184.      Besides the operations ci and co, RCS provides the fol-
  185. lowing commands:
  186.  
  187. ident       extract identification markers
  188. rcs         change RCS file attributes
  189. rcsclean    remove unchanged working files (optional)
  190. rcsdiff     compare revisions
  191. rcsfreeze   record a configuration (optional)
  192. rcsmerge    merge revisions
  193. rlog        read log messages and other information in RCS files
  194.  
  195. A synopsis of these commands appears in the Appendix.
  196.  
  197. 2.1. Automatic Identification
  198.  
  199.      RCS can stamp source and object code with special iden-
  200. tification  strings,  similar to product and serial numbers.
  201. To obtain such identification, place the marker
  202.  
  203.      $Id$
  204.  
  205. into the text of a revision, for instance inside a  comment.
  206. The  check-out  operation  will  replace  this marker with a
  207. string of the form
  208.  
  209.      $Id: filename revisionnumber date time author state locker $
  210.  
  211. This string need never be touched, because co keeps it up to
  212. date  automatically.   To  propagate  the marker into object
  213. code, simply put it into a literal character string.  In  C,
  214. this is done as follows:
  215.  
  216.      static char rcsid[] = "$Id$";
  217.  
  218. The command ident extracts such markers from  any  file,  in
  219. particular  from object code.  Ident helps to find out which
  220. revisions of which modules were used in a given program.  It
  221. returns  a  complete  and  unambiguous  component list, from
  222. which a copy of the  program  can  be  reconstructed.   This
  223. facility is invaluable for program maintenance.
  224.  
  225.      There are several  additional  identification  markers,
  226. one for each component of $Id$.  The marker
  227.  
  228.      $Log$
  229.  
  230. has a similar function.  It  accumulates  the  log  messages
  231. that  are requested during check-in.  Thus, one can maintain
  232. the complete history of a revision directly  inside  it,  by
  233. enclosing  it in a comment.  Figure 1 is a partial reproduc-
  234. tion of a log contained in revision 4.1 of  the  file  ci.c.
  235. The  log  appears at the beginning of the file, and makes it
  236. easy to determine what the recent modifications were.
  237.  
  238. /* $Log: ci.c,v $
  239.  * Revision 4.1  1983/05/10  17:03:06  wft
  240.  * Added option -d and -w, and updated assignment of date, etc.
  241.  * to new delta. Added handling of default branches.
  242.  *
  243.  * Revision 3.9  1983/02/15  15:25:44  wft
  244.  * Added call to fastcopy() to copy remainder of RCS file.
  245.  *
  246.  * Revision 3.8  1983/01/14  15:34:05  wft
  247.  * Added ignoring of interrupts while new RCS file is renamed;
  248.  * avoids deletion of RCS files by interrupts.
  249.  *
  250.  * Revision 3.7  1982/12/10  16:09:20  wft
  251.  * Corrected checking of return code from diff.
  252.  * An RCS file now inherits its mode during the first ci from
  253.  * the working file, except that write permission is removed.
  254.  */
  255.  
  256.      Figure 1.  Log entries produced by the marker $Log$.
  257.  
  258. Since revisions are stored in the form of differences,  each
  259. log  message  is  physically stored once, independent of the
  260. number of revisions present.  Thus, the $Log$ marker  incurs
  261. negligible space overhead.
  262.  
  263. 3.   The RCS Revision Tree
  264.  
  265.      RCS arranges revisions in an ancestral  tree.   The  ci
  266. command  builds  this tree; the auxiliary command rcs prunes
  267. it.  The tree has a root revision,  normally  numbered  1.1,
  268. and  successive  revisions  are numbered 1.2, 1.3, etc.  The
  269. first field of a  revision  number  is  called  the  release
  270. number  and  the  second one the level number.  Unless given
  271. explicitly, the ci command assigns a new revision number  by
  272. incrementing the level number of the previous revision.  The
  273. release number must be incremented explicitly, using the  -r
  274. option  of  ci.   Assuming there are revisions 1.1, 1.2, and
  275. 1.3 in the RCS file f.c,v, the command
  276.  
  277.      ci -r2.1 f.c       or       ci -r2 f.c
  278.  
  279. assigns the number 2.1 to the new revision.  Later check-ins
  280. without  the -r option will assign the numbers 2.2, 2.3, and
  281. so on.  The release number should  be  incremented  only  at
  282. major  transition  points  in  the development, for instance
  283. when a new release of a software product has been completed.
  284.  
  285. 3.1. When are branches needed?
  286.  
  287.      A young revision tree is slender: It consists  of  only
  288. one  branch,  called  the  trunk.   As  the  tree ages, side
  289. branches may form.  Branches are needed in the  following  4
  290. situations.
  291.  
  292. Temporary fixes
  293.  
  294.      Suppose a tree has 5 revisions grouped in  2  releases,
  295.      as illustrated in Figure 2.  Revision 1.3, the last one
  296.      of release 1, is in operation at customer sites,  while
  297.      release 2 is in active development.
  298.  
  299.      Now imagine a customer requesting a fix of a problem in
  300.      revision  1.3, although actual development has moved on
  301.      to release 2.  RCS does not permit an extra revision to
  302.      be spliced in between 1.3 and 2.1, since that would not
  303.      reflect  the  actual  development  history.    Instead,
  304.      create  a  branch at revision 1.3, and check in the fix
  305.      on that branch.  The first branch starting at  1.3  has
  306.      number 1.3.1, and the revisions on that branch are num-
  307.      bered 1.3.1.1, 1.3.1.2, etc.  The double  numbering  is
  308.      needed  to  allow for another branch at 1.3, say 1.3.2.
  309.      Revisions  on  the  second  branch  would  be  numbered
  310.      1.3.2.1,  1.3.2.2,  and  so  on.   The  following steps
  311.      create branch 1.3.1 and add revision 1.3.1.1:
  312.  
  313.           co  -r1.3  f.c      -- check out revision 1.3
  314.           edit  f.c           -- change it
  315.           ci  -r1.3.1  f.c    -- check it in on branch 1.3.1
  316.  
  317.      This sequence of commands transforms the tree of Figure
  318.      2 into the one in Figure 3.  Note that it may be neces-
  319.      sary to incorporate the  differences  between  1.3  and
  320.      1.3.1.1  into  a  revision  at  level 2.  The operation
  321.      rcsmerge automates this process (see the Appendix).
  322.  
  323. Distributed development and customer modifications
  324.  
  325.      Assume a situation as in Figure 2, where  revision  1.3
  326.      is  in  operation  at  several  customer  sites,  while
  327.      release 2 is in development.  Customer sites should use
  328.      RCS   to  store  the  distributed  software.   However,
  329.      customer modifications should not be placed on the same
  330.      branch  as the distributed source; instead, they should
  331.      be placed on a side branch.   When  the  next  software
  332.      distribution  arrives,  it  should  be  appended to the
  333.      trunk of the customer's RCS file, and the customer  can
  334.      then  merge  the  local modifications back into the new
  335.      release.  In the above example, a customer's  RCS  file
  336.      would  contain  the  following  tree, assuming that the
  337.      customer has received revision  1.3,  added  his  local
  338.      modifications  as revision 1.3.1.1, then received revi-
  339.      sion 2.4, and merged  2.4  and  1.3.1.1,  resulting  in
  340.      2.4.1.1.
  341.  
  342.      This approach is actually practiced in the  CSNET  pro-
  343.      ject,   where   several   universities  and  a  company
  344.      cooperate in developing a national computer network.
  345.  
  346. Parallel development
  347.  
  348.      Sometimes it  is  desirable  to  explore  an  alternate
  349.      design  or  a  different  implementation  technique  in
  350.      parallel with the main line development.  Such develop-
  351.      ment  should  be  carried  out  on  a side branch.  The
  352.      experimental changes may later be moved into  the  main
  353.      line, or abandoned.
  354.  
  355. Conflicting updates
  356.  
  357.      A common occurrence is that one programmer has  checked
  358.      out  a revision, but cannot complete the assignment for
  359.      some reason.  In the meantime, another person must per-
  360.      form  another  modification immediately.  In that case,
  361.      the second person should check-out the  same  revision,
  362.      modify  it, and check it in on a side branch, for later
  363.      merging.
  364.  
  365.      Every node in a revision tree consists of the following
  366. attributes: a revision number, a check-in date and time, the
  367. author's identification, a log entry, a state and the actual
  368. text.   All  these attributes are determined at the time the
  369. revision is checked in.  The state attribute  indicates  the
  370. status  of  a revision.  It is set automatically to `experi-
  371. mental' during check-in.  A revision can later  be  promoted
  372. to a higher status, for example `stable' or `released'.  The
  373. set of states is user-defined.
  374.  
  375. 3.2. Revisions are represented as deltas
  376.  
  377.      For conserving space, RCS stores revisions in the  form
  378. of deltas, i.e., as differences between revisions.  The user
  379. interface completely hides this fact.
  380.  
  381.      A delta is a sequence of edit commands that  transforms
  382. one  string  into  another.   The deltas employed by RCS are
  383. line-based, which means that the only edit commands  allowed
  384. are  insertion and deletion of lines.  If a single character
  385. in a line is changed, the edit scripts consider  the  entire
  386. line  changed.   The  program  diff2 produces a small, line-
  387. based delta between pairs of text files.  A  character-based
  388. edit script would take much longer to compute, and would not
  389. be significantly shorter.
  390.  
  391.      Using deltas is a classical space-time tradeoff: deltas
  392. reduce  the  space consumed, but increase access time.  How-
  393. ever, a version control tool should impose as  little  delay
  394. as possible on programmers.  Excessive delays discourage the
  395. use of version  controls,  or  induce  programmers  to  take
  396. shortcuts that compromise system integrity.  To gain reason-
  397. ably fast access time for both editing  and  compiling,  RCS
  398. arranges deltas in the following way.  The most recent revi-
  399. sion on the trunk is stored intact.  All other revisions  on
  400. the  trunk  are  stored  as reverse deltas.  A reverse delta
  401. describes how to go backward in the development history:  it
  402. produces the desired revision if applied to the successor of
  403. that revision.  This implementation has the  advantage  that
  404. extraction  of the latest revision is a simple and fast copy
  405. operation.  Adding a new revision to the trunk is also fast:
  406. ci  simply adds the new revision intact, replaces the previ-
  407. ous revision with a reverse delta, and keeps the rest of the
  408. old  deltas.   Thus, ci requires the computation of only one
  409. new delta.
  410.  
  411.      Branches need special treatment.   The  naive  solution
  412. would  be  to  store  complete  copies  for  the tips of all
  413. branches.  Clearly, this approach would cost too much space.
  414. Instead, RCS uses forward deltas for branches.  Regenerating
  415. a revision on a side branch  proceeds  as  follows.   First,
  416. extract  the  latest  revision on the trunk; secondly, apply
  417. reverse deltas until the fork revision  for  the  branch  is
  418. obtained;  thirdly,  apply  forward deltas until the desired
  419. branch revision is reached.  Figure  5  illustrates  a  tree
  420. with  one  side  branch.  Triangles pointing to the left and
  421. right represent reverse and forward deltas, respectively.
  422.  
  423.      Although implementing fast  check-out  for  the  latest
  424. trunk  revision,  this arrangement has the disadvantage that
  425. generation of other revisions takes time proportional to the
  426. number  of  deltas  applied.   For example, regenerating the
  427. branch tip in Figure 5 requires application of  five  deltas
  428. (including  the  initial  one).  Since usage statistics show
  429. that the latest trunk revision is the one that is  retrieved
  430. in  95  per  cent  of  all  cases  (see the section on usage
  431. statistics), biasing check-out time in favor of  that  revi-
  432. sion  results  in  significant  savings.   However,  careful
  433. implementation of the delta application process is necessary
  434. to  provide  low  retrieval overhead for other revisions, in
  435. particular for branch tips.
  436.  
  437.      There are several  techniques  for  delta  application.
  438. The  naive  one  is  to pass each delta to a general-purpose
  439. text editor.  A prototype of RCS invoked the UNIX editor  ed
  440. both  for  applying deltas and for expanding the identifica-
  441. tion markers.  Although easy to implement,  performance  was
  442. poor, owing to the high start-up costs and excess generality
  443. of ed.  An intermediate  version  of  RCS  used  a  special-
  444. purpose, stream-oriented editor.  This technique reduced the
  445. cost of applying a delta to the cost  of  checking  out  the
  446. latest trunk revision.  The reason for this behavior is that
  447. each delta application involves a  complete  pass  over  the
  448. preceding revision.
  449.  
  450.      However, there is a much better algorithm.   Note  that
  451. the  deltas are line oriented and that most of the work of a
  452. stream editor involves  copying  unchanged  lines  from  one
  453. revision to the next.  A faster algorithm avoids unnecessary
  454. copying of character strings by  using  a  piece  table.   A
  455. piece  table  is  a  one-dimensional array, specifying how a
  456. given revision is `pieced together' from lines  in  the  RCS
  457. file.   Suppose piece table PTr represents revision r.  Then
  458. PTr[i] contains the starting position of line i of  revision
  459. r.  Application of the next delta transforms piece table PTr
  460. into PTr+1.  For instance, a delete command removes a series
  461. of  entries  from  the  piece  table.   An insertion command
  462. inserts new entries, moving the entries following the inser-
  463. tion  point  further  down  the array.  The inserted entries
  464. point to the text lines in  the  delta.   Thus,  no  I/O  is
  465. involved except for reading the delta itself.  When all del-
  466. tas have been applied to the piece table, a sequential  pass
  467. through  the  table  looks  up each line in the RCS file and
  468. copies it to the output file, updating identification  mark-
  469. ers  at  the same time.  Of course, the RCS file must permit
  470. random  access,  since  the  copied  lines   are   scattered
  471. throughout that file.  Figure 6 illustrates an RCS file with
  472. two revisions and the corresponding piece tables.
  473.  
  474.      The piece table approach has the property that the time
  475. for  applying  a  single  delta is roughly determined by the
  476. size of the delta, and not by the size of the revision.  For
  477. example,  if  a  delta is 10 per cent of the size of a revi-
  478. sion, then applying it takes only 10 per cent of the time to
  479. generate  the  latest  trunk  revision.   (The stream editor
  480. would take 100 per cent.)
  481.  
  482.      There is an important alternative for representing del-
  483. tas  that  affects  performance.  SCCS3, a precursor of RCS,
  484. uses interleaved deltas.  A file containing interleaved del-
  485. tas  is  partitioned into blocks of lines.  Each block has a
  486. header  that  specifies  to  which  revision(s)  the   block
  487. belongs.   The  blocks  are  sorted out in such a way that a
  488. single pass over the file can pick up all the lines  belong-
  489. ing  to  a  given revision.  Thus, the regeneration time for
  490. all revisions is the same: all headers  must  be  inspected,
  491. and  the associated blocks either copied or skipped.  As the
  492. number of revisions increases, the cost  of  retrieving  any
  493. revision  is  much  higher than the cost of checking out the
  494. latest trunk revision with reverse deltas.  A detailed  com-
  495. parison  of SCCS's interleaved deltas and RCS's reverse del-
  496. tas can be found in Reference 4.  This  reference  considers
  497. the  version  of RCS with the stream editor only.  The piece
  498. table method improves performance further, so  that  RCS  is
  499. always  faster  than  SCCS,  except if 10 or more deltas are
  500. applied.
  501.  
  502.      Additional speed-up  for  both  delta  methods  can  be
  503. obtained by caching the most recently generated revision, as
  504. has been implemented in DSEE.5 With caching, access time  to
  505. frequently  used  revisions  can approach normal file access
  506. time, at the cost of some additional space.
  507.  
  508. 4.   Locking: A Controversial Issue
  509.  
  510.      The locking mechanism for RCS was difficult to  design.
  511. The  problem  and  its solution are first presented in their
  512. `pure' form, followed by a discussion of  the  complications
  513. caused by `real-world' considerations.
  514.  
  515.      RCS must prevent two or more  persons  from  depositing
  516. competing  changes  of  the same revision.  Suppose two pro-
  517. grammers check out revision 2.4 and modify it.  Programmer A
  518. checks  in  a  revision before programmer B.  Unfortunately,
  519. programmer B has not seen A's changes, so the effect is that
  520. A's  changes are covered up by B's deposit.  A's changes are
  521. not lost since all revisions are saved, but  they  are  con-
  522. fined to a single revision.=
  523.  
  524.      This conflict is prevented in RCS by locking.  Whenever
  525. someone intends to edit a revision (as opposed to reading or
  526. compiling it),  the  revision  should  be  checked  out  and
  527. locked,  using the -l option on co.  On subsequent check-in,
  528. ci tests the lock and then removes it.  At most one program-
  529. mer  at a time may lock a particular revision, and only this
  530. programmer may check  in  the  succeeding  revision.   Thus,
  531. while a revision is locked, it is the exclusive responsibil-
  532. ity of the locker.
  533.  
  534.      An important maxim for software tools like RCS is  that
  535. they  must  not  stand  in the way of making progress with a
  536. project.  This consideration leads to several weakenings  of
  537. the  locking mechanism.  First of all, even if a revision is
  538. locked, it can still be checked out.  This is  necessary  if
  539. other  people wish to compile or inspect the locked revision
  540. while the next one is in preparation.  The  only  operations
  541. they  cannot  do are to lock the revision or to check in the
  542. succeeding one.   Secondly,  check-in  operations  on  other
  543. branches  in the RCS file are still possible; the locking of
  544. one revision does not affect any other  revision.   Thirdly,
  545. revisions  are occasionally locked for a long period of time
  546. because a programmer is absent or otherwise unable  to  com-
  547. plete  the  assignment.  If another programmer has to make a
  548. pressing change, there are the following three  alternatives
  549. for making progress: a) find out who is holding the lock and
  550. ask that person to release it; b) check out the locked revi-
  551. sion,  modify  it,  check  it  in on a branch, and merge the
  552. changes later; c) break the lock.  Breaking a lock leaves  a
  553. highly visible trace, namely an electronic mail message that
  554. is sent automatically to the holder of the  lock,  recording
  555. the  breaker  and  a  commentary  requested from him.  Thus,
  556. breaking locks is tolerated under certain circumstances, but
  557. will  not  go  unnoticed.   Experience  has  shown  that the
  558. automatic mail message attaches a high enough stigma to lock
  559. breaking,  such  that  programmers  break locks only in real
  560. emergencies, or when a co-worker resigns and  leaves  locked
  561. revisions behind.
  562.  
  563.      If an RCS file is private, i.e., when a programmer owns
  564. an  RCS  file  and  does  not  expect anyone else to perform
  565. check-in operations, locking is an unnecessary nuisance.  In
  566. this  case,  the  `strict locking feature' discussed earlier
  567. may be disabled, provided that file protection is  set  such
  568. that  only  the  owner may write the RCS file.  This has the
  569. effect that only the owner can check-in revisions, and  that
  570. no lock is needed for doing so.
  571.  
  572.      As added protection, each RCS file contains  an  access
  573. list  that specifies the users who may execute update opera-
  574. tions.  If an access list is empty, only  normal  UNIX  file
  575. protection  applies.   Thus,  the  access list is useful for
  576. restricting the set  of  people  who  would  otherwise  have
  577. update  permission.   Just  as with locking, the access list
  578. has no effect on read-only  operations  such  as  co.   This
  579. approach is consistent with the UNIX philosophy of openness,
  580. which  contributes  to  a  productive  software  development
  581. environment.
  582.  
  583. 5.   Configuration Management
  584.  
  585.      The preceding sections described  how  RCS  deals  with
  586. revisions  of  individual components; this section discusses
  587. how to handle configurations.  A configuration is a  set  of
  588. revisions,  where each revision comes from a different revi-
  589. sion group, and the revisions are selected  according  to  a
  590. certain  criterion.   For example, in order to build a func-
  591. tioning compiler, the `right' revisions  from  the  scanner,
  592. the  parser,  the  optimizer  and the code generator must be
  593. combined.  RCS, in conjunction with MAKE, provides a  number
  594. of facilities to effect a smooth selection.
  595.  
  596. 5.1. RCS Selection Functions
  597.  
  598. Default selection
  599.  
  600.      During development, the usual selection criterion is to
  601.      choose  the  latest revision of all components.  The co
  602.      command makes this selection by default.  For  example,
  603.      the command
  604.  
  605.              co  *,v
  606.  
  607.      retrieves the latest revision on the default branch  of
  608.      each  RCS  file  in the current directory.  The default
  609.      branch is usually the trunk, but may be  set  to  be  a
  610.      side  branch.   Side branches as defaults are needed in
  611.      distributed software development, as discussed  in  the
  612.      section on the RCS revision tree.
  613.  
  614. Release based selection
  615.  
  616.      Specifying a  release  or  branch  number  selects  the
  617.      latest   revision  in  that  release  or  branch.   For
  618.      instance,
  619.  
  620.              co  -r2  *,v
  621.  
  622.      retrieves the latest revision  with  release  number  2
  623.      from  each RCS file.  This selection is convenient if a
  624.      release has been completed and development has moved on
  625.      to the next release.
  626.  
  627. State and author based selection
  628.  
  629.      If the highest level  number  within  a  given  release
  630.      number  is not the desired one, the state attribute can
  631.      help.  For example,
  632.  
  633.              co  -r2  -sReleased  *,v
  634.  
  635.      retrieves the latest revision  with  release  number  2
  636.      whose  state  attribute  is `Released'.  Of course, the
  637.      state attribute has to be set appropriately, using  the
  638.      ci or rcs commands.  Another alternative is to select a
  639.      revision by its author, using the -w option.
  640.  
  641. Date based selection
  642.  
  643.      Revisions may also be  selected  by  date.   Suppose  a
  644.      release  of  an entire system was completed and current
  645.      on March 4, at 1:00 p.m. local time.  Then the command
  646.  
  647.              co  -d'March 4, 1:00 pm LT'  *,v
  648.  
  649.      checks out all the components of that release, indepen-
  650.      dent of the numbering.  The -d option specifies a `cut-
  651.      off date', i.e., the revision selected has  a  check-in
  652.      date that is closest to, but not after the date given.
  653.  
  654. Name based selection
  655.  
  656.      The  most  powerful  selection  function  is  based  on
  657.      assigning symbolic names to revisions and branches.  In
  658.      large systems, a single release number or date  is  not
  659.      sufficient  to  collect  the appropriate revisions from
  660.      all groups.  For example, suppose one wishes to combine
  661.      release  2  of one subsystem and release 15 of another.
  662.      Most likely,  the  creation  dates  of  those  releases
  663.      differ  also.   Thus,  a single revision number or date
  664.      passed to the co command will not suffice to select the
  665.      right  revisions.  Symbolic revision numbers solve this
  666.      problem.  Each RCS file may contain a set  of  symbolic
  667.      names that are mapped to numeric revision numbers.  For
  668.      example, assume the  symbol  V3  is  bound  to  release
  669.      number  2  in  file s,v, and to revision number 15.9 in
  670.      t,v.  Then the single command
  671.  
  672.              co  -rV3  s,v  t,v
  673.  
  674.      retrieves the latest revision of release  2  from  s,v,
  675.      and  revision  15.9  from  t,v.  In a large system with
  676.      many modules,  checking  out  all  revisions  with  one
  677.      command greatly simplifies configuration management.
  678.  
  679.      Judicious use of symbolic revision numbers  helps  with
  680. organizing   large   configurations.    A  special  command,
  681. rcsfreeze, assigns a symbolic revision number to a  selected
  682. revision in every RCS file.  Rcsfreeze effectively freezes a
  683. configuration.   The  assigned  symbolic   revision   number
  684. selects  all components of the configuration.  If necessary,
  685. symbolic numbers may even be intermixed with  numeric  ones.
  686. Thus, V3.5 in the above example would select revision 2.5 in
  687. s,v and branch 15.9.5 in t,v.
  688.  
  689.      The options -r, -s, -w and -d may be  combined.   If  a
  690. branch is given, the latest revision on that branch satisfy-
  691. ing all conditions  is  retrieved;  otherwise,  the  default
  692. branch is used.
  693.  
  694. 5.2. Combining MAKE and RCS
  695.  
  696.      MAKE1 is a program that processes  configurations.   It
  697. is driven by configuration specifications recorded in a spe-
  698. cial file, called a `Makefile'.  MAKE avoids redundant  pro-
  699. cessing steps by comparing creation dates of source and pro-
  700. cessed objects.  For example, when instructed to compile all
  701. modules  of  a given system, it only recompiles those source
  702. modules that were changed since they were processed last.
  703.  
  704.      MAKE has been extended with  an  auto-checkout  feature
  705. for RCS.* When  a  certain  file  to  be  processed  is  not
  706. present,  MAKE  attempts a check-out operation.  If success-
  707. ful, MAKE performs the required processing, and then deletes
  708. the  checked  out  file  to  conserve  space.  The selection
  709. parameters discussed above can be passed to MAKE  either  as
  710. parameters,  or directly embedded in the Makefile.  MAKE has
  711. also been extended to search the subdirectory named RCS  for
  712. needed  files,  rather  than just the current working direc-
  713. tory.  However, if a working file is present,  MAKE  totally
  714. ignores  the  corresponding  RCS  file  and uses the working
  715. file.  (In newer versions of MAKE distributed  by  AT&T  and
  716. others, auto-checkout can be achieved with the rule DEFAULT,
  717. instead of a special extension of  MAKE.   However,  a  file
  718. checked  out  by  the rule DEFAULT will not be deleted after
  719. processing. Rcsclean can be used for that purpose.)
  720.  
  721.      With auto-checkout, RCS/MAKE  can  effect  a  selection
  722. rule  especially tuned for multi-person software development
  723. and maintenance.  In these  situations,  programmers  should
  724. obtain  configurations  that  consist  of the revisions they
  725. have personally checked out plus the latest checked in revi-
  726. sion  of  all other revision groups.  This schema can be set
  727. up as follows.
  728.  
  729.      Each programmer chooses a working directory and  places
  730. into  it  a  symbolic link, named RCS, to the directory con-
  731. taining the relevant RCS files.   The  symbolic  link  makes
  732. sure that co and ci operations need only specify the working
  733. files, and that the Makefile need not be changed.  The  pro-
  734. grammer  then checks out the needed files and modifies them.
  735. If MAKE is invoked, it composes configurations by  selecting
  736. those  revisions that are checked out, and the rest from the
  737. subdirectory RCS.  The latter selection may be controlled by
  738. a  symbolic  revision  number  or any of the other selection
  739. criteria.  If  there  are  several  programmers  editing  in
  740. separate  working  directories, they are insulated from each
  741. other's changes until checking in their modifications.
  742.  
  743.      Similarly, a maintainer can recreate  an  older  confi-
  744. guration  by starting to work in an empty working directory.
  745. During  the  initial  MAKE  invocation,  all  revisions  are
  746. selected from RCS files.  As the maintainer checks out files
  747. and modifies them, a new configuration  is  gradually  built
  748. up.  Every time MAKE is invoked, it substitutes the modified
  749. revisions into the configuration being manipulated.
  750.  
  751.      A final application of RCS is to  use  it  for  storing
  752. Makefiles.   Revision groups of Makefiles represent multiple
  753. versions of configurations.   Whenever  a  configuration  is
  754. baselined  or distributed, the best approach is to unambigu-
  755. ously fix the configuration with a symbolic revision  number
  756. by   calling  rcsfreeze,  to  embed  that  symbol  into  the
  757. Makefile, and to check in the Makefile (using the same  sym-
  758. bolic  revision number).  With this approach, old configura-
  759. tions can be regenerated easily and reliably.
  760.  
  761. 6.   Usage Statistics
  762.  
  763.      The following usage statistics were  collected  on  two
  764. DEC  VAX-11/780  computers  of  the  Purdue Computer Science
  765. Department.  Both machines are mainly used for research pur-
  766. poses.   Thus,  the data reflect an environment in which the
  767. majority  of  projects  involve  prototyping  and   advanced
  768. software   development,   but  relatively  little  long-term
  769. maintenance.
  770.  
  771.      For the first experiment, the ci and co operations were
  772. instrumented  to log the number of backward and forward del-
  773. tas applied.  The data were  collected  during  a  13  month
  774. period  from Dec. 1982 to Dec. 1983.  Table I summarizes the
  775. results.
  776.  
  777. ___________________________________________________________________________
  778. Operation     Total    Total deltas  Mean deltas   Operations      Branch
  779.            operations    applied       applied    with >1 delta  operations
  780. ___________________________________________________________________________
  781. co             7867        9320         1.18      509    (6%)    203   (3%)
  782. ci             3468        2207         0.64       85    (2%)     75   (2%)
  783. ci & co       11335       11527         1.02      594    (5%)    278   (2%)
  784. ___________________________________________________________________________
  785.  
  786.        Table I.  Statistics for co and ci operations.
  787.  
  788.      The first two lines show statistics for  check-out  and
  789. check-in; the third line shows the combination.  Recall that
  790. ci performs an implicit check-out to obtain a  revision  for
  791. computing  the  delta.   In all measures presented, the most
  792. recent revision (stored intact) counts as  one  delta.   The
  793. number  of  deltas  applied  represents the number of passes
  794. necessary, where the first `pass' is a copying step.
  795.  
  796.      Note that the check-out operation is executed more than
  797. twice  as  frequently as the check-in operation.  The fourth
  798. column gives the mean number of deltas applied in all  three
  799. cases.   For  ci,  the mean number of deltas applied is less
  800. than  one.   The  reasons  are  that  the  initial  check-in
  801. requires no delta at all, and that the only time ci requires
  802. more than one delta is for branches.   Column  5  shows  the
  803. actual  number  of  operations  that  applied  more than one
  804. delta.  The last column indicates  that  branches  were  not
  805. used often.
  806.  
  807.      The last three columns demonstrate that the most recent
  808. trunk  revision is by far the most frequently accessed.  For
  809. RCS, check-out of this revision is a simple copy  operation,
  810. which  is  the  absolute minimum given the copy-semantics of
  811. co.  Access to older revisions and branches is  more  common
  812. in  non-academic  environments,  yet even if access to older
  813. deltas were an order of magnitude more  frequent,  the  com-
  814. bined  average number of deltas applied would still be below
  815. 1.2.  Since RCS is faster than SCCS until  up  to  10  delta
  816. applications,  reverse  deltas  are  clearly  the  method of
  817. choice.
  818.  
  819.      The second experiment,  conducted  in  March  of  1984,
  820. involved  surveying  the  existing  RCS  files  on  our  two
  821. machines.  The goal was to  determine  the  mean  number  of
  822. revisions  per  RCS  file,  as well as the space consumed by
  823. them.  Table II shows the results.  (Tables I  and  II  were
  824. produced at different times and are unrelated.)
  825. __________________________________________________________________________________
  826.              Total RCS    Total      Mean     Mean size of  Mean size of  Overhead
  827.                files    revisions  revisions   RCS files     revisions
  828. __________________________________________________________________________________
  829. All files      8033       11133      1.39         6156          5585        1.10
  830. Files with     1477        4578      3.10         8074          6041        1.34
  831. >= 2 deltas
  832. __________________________________________________________________________________
  833.  
  834.             Table II.  Statistics for RCS files.
  835.  
  836.      The mean number of revisions  per  RCS  file  is  1.39.
  837. Columns  5  and  6  show the mean sizes (in bytes) of an RCS
  838. file and of the latest revision of each  RCS  file,  respec-
  839. tively.   The  `overhead'  column  contains the ratio of the
  840. mean sizes.  Assuming that all revisions in an RCS file  are
  841. approximately  the  same size, this ratio gives a measure of
  842. the space consumed by the extra revisions.
  843.  
  844.      In our sample, over 80 per cent of the RCS  files  con-
  845. tained  only a single revision.  The reason is that our sys-
  846. tems programmers routinely check in all source files on  the
  847. distribution  tapes,  even  though they may never touch them
  848. again.  To get a better indication of how much space savings
  849. are possible with deltas, all measures with those files that
  850. contained 2 or more revisions  were  recomputed.   Only  for
  851. those  files is RCS necessary.  As shown in the second line,
  852. the average number of revisions for  those  files  is  3.10,
  853. with  an  overhead  of 1.34.  This means that the extra 2.10
  854. deltas require 34 per cent extra space, or 16 per  cent  per
  855. extra  revision.   Rochkind3  measured the space consumed by
  856. SCCS, and reported an average of 5 revisions per  group  and
  857. an  overhead  of  1.37  (or about 9 per cent per extra revi-
  858. sion).  In a later paper, Glasser6 observed an average of  7
  859. revisions per group in a single, large project, but provided
  860. no overhead figure.  In his paper on DSEE5, Leblang reported
  861. that  delta  storage combined with blank compression results
  862. in an overhead of a mere 1-2 per cent per  revision.   Since
  863. leading  blanks  accounted for about 20 per cent of the sur-
  864. veyed Pascal programs, a revision group  with  5-10  members
  865. was smaller than a single cleartext copy.
  866.  
  867.      The above observations  demonstrate  clearly  that  the
  868. space  needed  for  extra  revisions  is  small.  With delta
  869. storage, the luxury of keeping multiple revisions online  is
  870. certainly  affordable.   In  fact, introducing a system with
  871. delta storage may reduce storage requirements, because  pro-
  872. grammers  often  save  back-up copies anyway.  Since back-up
  873. copies are stored much more efficiently with deltas,  intro-
  874. ducing a system such as RCS may actually free a considerable
  875. amount of space.
  876.  
  877. 7.  Survey of Version Control Tools
  878.  
  879.      The need to keep back-up copies of software arose  when
  880. programs  and data were no longer stored on paper media, but
  881. were entered from terminals and  stored  on  disk.   Back-up
  882. copies  are  desirable for reliability, and many modern edi-
  883. tors automatically  save  a  back-up  copy  for  every  file
  884. touched.  This strategy is valuable for short-term back-ups,
  885. but not suitable for long-term  version  control,  since  an
  886. existing   back-up   copy   is   overwritten   whenever  the
  887. corresponding file is edited.
  888.  
  889.      Tape  archives  are  suitable  for  long-term,  offline
  890. storage.   If all changed files are dumped on a back-up tape
  891. once per day, old  revisions  remain  accessible.   However,
  892. tape  archives  are  unsatisfactory  for  version control in
  893. several ways.  First, backing up the file  system  every  24
  894. hours  does  not  capture intermediate revisions.  Secondly,
  895. the old revisions are not  online,  and  accessing  them  is
  896. tedious  and time-consuming.  In particular, it is impracti-
  897. cal to compare several old revisions  of  a  group,  because
  898. that may require mounting and searching several tapes.  Tape
  899. archives are important  fail-safe  tools  in  the  event  of
  900. catastrophic disk failures or accidental deletions, but they
  901. are ill-suited for  version  control.   Conversely,  version
  902. control tools do not obviate the need for tape archives.
  903.  
  904.      A natural technique for keeping several  old  revisions
  905. online  is  to  never  delete a file.  Editing a file simply
  906. creates a new file with the same name, but with a  different
  907. sequence  number.  This technique, available as an option in
  908. DEC's VMS operating system, turns out to be  inadequate  for
  909. version  control.   First,  it is prohibitively expensive in
  910. terms of storage costs, especially since no data compression
  911. techniques are employed.  Secondly, indiscriminately storing
  912. every change produces too many  revisions,  and  programmers
  913. have difficulties distinguishing them.  The proliferation of
  914. revisions forces programmers to spend much time  on  finding
  915. and  deleting  useless  files.  Thirdly, most of the support
  916. functions like locking,  logging,  revision  selection,  and
  917. identification described in this paper are not available.
  918.  
  919.      An alternative approach is  to  separate  editing  from
  920. revision  control.   The  user  may  repeatedly edit a given
  921. revision, until freezing it with an explicit command.   Once
  922. a  revision  is  frozen, it is stored permanently and can no
  923. longer be modified.  (In RCS, freezing a revisions  is  done
  924. with ci.) Editing a frozen revision implicitly creates a new
  925. one, which can again  be  changed  repeatedly  until  it  is
  926. frozen  itself.  This approach saves exactly those revisions
  927. that the user considers important, and keeps the  number  of
  928. revisions  manageable.   IBM's  CLEAR/CASTER7, AT&T's SCCS3,
  929. CMU's SDC8 and DEC's CMS9, are examples of  version  control
  930. systems  using this approach.  CLEAR/CASTER maintains a data
  931. base of programs,  specifications,  documentation  and  mes-
  932. sages,  using  deltas.   Its goal is to provide control over
  933. the development process from a management  viewpoint.   SCCS
  934. stores  multiple  revisions  of  source text in an ancestral
  935. tree, records a log entry for each revision, provides access
  936. control,  and  has  facilities for uniquely identifying each
  937. revision.  An efficient delta technique  reduces  the  space
  938. consumed  by  each revision group.  SDC is much simpler than
  939. SCCS because it stores not more than  two  revisions.   How-
  940. ever,  it  maintains  a  complete log for all old revisions,
  941. some of which may be  on  back-up  tape.   CMS,  like  SCCS,
  942. manages tree-structured revision groups, but offers no iden-
  943. tification mechanism.
  944.  
  945.      Tools for dealing with configurations are  still  in  a
  946. state  of flux.  SCCS, SDC and CMS can be combined with MAKE
  947. or MAKE-like programs.  Since flexible selection  rules  are
  948. missing  from  all these tools, it is sometimes difficult to
  949. specify precisely which revision of  each  group  should  be
  950. passed  to  MAKE  for building a desired configuration.  The
  951. Xerox Cedar system10 provides a `System Modeller'  that  can
  952. rebuild  a  configuration  from  an  arbitrary set of module
  953. revisions.  The revisions of a module are only distinguished
  954. by  creation time, and there is no tool for managing groups.
  955. Since the selection rules are primitive, the System Modeller
  956. appears  to be somewhat tedious to use.  Apollo's DSEE5 is a
  957. sophisticated software engineering environment.  It  manages
  958. revision  groups  in  a way similar to SCCS and CMS.  Confi-
  959. gurations are built using `configuration threads'.  A confi-
  960. guration thread states which revision of each group named in
  961. a configuration should be chosen.   A  configuration  thread
  962. may  contain dynamic specifiers (e.g., `choose the revisions
  963. I am currently working on, and  the  most  recent  revisions
  964. otherwise'),  which  are  bound automatically at build time.
  965. It also provides a notification mechanism for alerting main-
  966. tainers about the need to rebuild a system after a change.
  967.  
  968.      RCS is based on a general model for  describing  multi-
  969. version/multi-configuration  systems11.  The model describes
  970. systems using AND/OR graphs, where AND nodes represent  con-
  971. figurations,  and  OR  nodes  represent version groups.  The
  972. model gives rise to a suit of selection rules for  composing
  973. configurations,  almost all of which are implemented in RCS.
  974. The revisions selected by RCS are passed to MAKE for  confi-
  975. guration  building.   Revision  group management is modelled
  976. after SCCS.  RCS retains SCCS's best features, but offers  a
  977. significantly  simpler  user  interface,  flexible selection
  978. rules, adequate integration with MAKE and improved identifi-
  979. cation.   A  detailed  comparison of RCS and SCCS appears in
  980. Reference 4.
  981.  
  982.      An important component of all revision control  systems
  983. is  a  program  for  computing deltas.  SCCS and RCS use the
  984. program diff2, which first computes the longest common  sub-
  985. string  of  two  revisions, and then produces the delta from
  986. that substring.  The delta is simply an edit script consist-
  987. ing  of  deletion  and  insertion commands that generate one
  988. revision from the other.
  989.  
  990.      A delta based on a  longest  common  substring  is  not
  991. necessarily  minimal,  because it does not take advantage of
  992. crossing block moves.  Crossing block moves arise if two  or
  993. more  blocks  of  lines  (e.g., procedures) appear in a dif-
  994. ferent order in two revisions.  An edit script derived  from
  995. a  longest common substring first deletes the shorter of the
  996. two blocks, and then reinserts  it.   Heckel12  proposed  an
  997. algorithm for detecting block moves, but since the algorithm
  998. is based on heuristics, there are conditions under which the
  999. generated  delta  is far from minimal.  DSEE uses this algo-
  1000. rithm  combined  with  blank  compression,  apparently  with
  1001. satisfactory  overall  results.   A  new  algorithm  that is
  1002. guaranteed to produce a minimal delta based on  block  moves
  1003. appears  in  Reference 13.  A future release of RCS will use
  1004. this algorithm.
  1005.  
  1006.      Acknowledgements: Many people have helped  make  RCS  a
  1007. success by contributed criticisms, suggestions, corrections,
  1008. and even whole new commands (including manual  pages).   The
  1009. list  of  people  is  too long to be reproduced here, but my
  1010. sincere thanks for their help and goodwill goes  to  all  of
  1011. them.
  1012.  
  1013. Appendix: Synopsis of RCS Operations
  1014.  
  1015. ci - check in revisions
  1016.  
  1017.      Ci stores the contents  of  a  working  file  into  the
  1018.      corresponding  RCS  file as a new revision.  If the RCS
  1019.      file doesn't exist, ci  creates  it.   Ci  removes  the
  1020.      working  file,  unless  one  of the options -u or -l is
  1021.      present.  For each check-in, ci asks for  a  commentary
  1022.      describing  the  changes relative to the previous revi-
  1023.      sion.
  1024.  
  1025.      Ci assigns the revision number given by the -r  option;
  1026.      if  that  option is missing, it derives the number from
  1027.      the lock held by the user; if  there  is  no  lock  and
  1028.      locking  is not strict, ci increments the number of the
  1029.      latest revision on the trunk.  A side branch  can  only
  1030.      be started by explicitly specifying its number with the
  1031.      -r option during check-in.
  1032.  
  1033.      Ci also determines whether the revision to  be  checked
  1034.      in is different from the previous one, and asks whether
  1035.      to proceed if not.  This facility  simplifies  check-in
  1036.      operations  for  large  systems,  because  one need not
  1037.      remember which files were changed.
  1038.  
  1039.      The option -k searches the checked in file for identif-
  1040.      ication  markers  containing  the  attributes  revision
  1041.      number, check-in date, author and  state,  and  assigns
  1042.      these  to  the new revision rather than computing them.
  1043.      This option is useful for software distribution:  Reci-
  1044.      pients  of  distributed software using RCS should check
  1045.      in updates with the -k option.  This convention guaran-
  1046.      tees  that  revision numbers, check-in dates, etc., are
  1047.      the same at all sites.
  1048.  
  1049. co - check out revisions
  1050.  
  1051.      Co retrieves revisions according  to  revision  number,
  1052.      date,  author  and  state attributes.  It either places
  1053.      the revision into the working file, or prints it on the
  1054.      standard  output.  Co always expands the identification
  1055.      markers.
  1056.  
  1057. ident - extract identification markers
  1058.  
  1059.      Ident extracts the identification markers  expanded  by
  1060.      co from any file and prints them.
  1061.  
  1062. rcs - change RCS file attributes
  1063.  
  1064.      Rcs is an administrative operation that changes  access
  1065.      lists,   locks,  unlocks,  breaks  locks,  toggles  the
  1066.      strict-locking feature, sets state attributes and  sym-
  1067.      bolic  revision  numbers,  changes the description, and
  1068.      deletes revisions.  A revision can only be  deleted  if
  1069.      it is not the fork of a side branch.
  1070.  
  1071. rcsclean - clean working directory
  1072.  
  1073.      Rcsclean removes working files that  were  checked  out
  1074.      but never changed.*
  1075.  
  1076. rcsdiff - compare revisions
  1077.  
  1078.      Rcsdiff compares two revisions and prints their differ-
  1079.      ence,  using  the UNIX tool diff.  One of the revisions
  1080.      compared may be checked out.  This  command  is  useful
  1081.      for finding out about changes.
  1082.  
  1083. rcsfreeze - freeze a configuration
  1084.  
  1085.      Rcsfreeze assigns the same symbolic revision number  to
  1086.      a  given  revision  in  all RCS files.  This command is
  1087.      useful for accurately recording a configuration.*
  1088.  
  1089. rcsmerge - merge revisions
  1090.  
  1091.      Rcsmerge merges two  revisions,  rev1  and  rev2,  with
  1092.      respect  to a common ancestor.  A 3-way file comparison
  1093.      determines the segments of lines that are (a) the  same
  1094.      in all three revisions, or (b) the same in 2 revisions,
  1095.      or (c) different in all three.   For  all  segments  of
  1096.      type (b) where rev1 is the differing revision, the seg-
  1097.      ment in rev1  replaces  the  corresponding  segment  of
  1098.      rev2.   Type  (c)  indicates  an overlapping change, is
  1099.      flagged as an error, and requires user intervention  to
  1100.      select the correct alternative.
  1101.  
  1102. rlog - read log messages
  1103.  
  1104.      Rlog prints the log messages and other  information  in
  1105.      an RCS file.
  1106.  
  1107. References
  1108.  
  1109. 1.   Feldman, Stuart I., "Make--A  Program  for  Maintaining
  1110.      Computer  Programs,"  Software--Practice  & Experience,
  1111.      vol. 9, no. 3, pp. 255-265, March 1979.
  1112.  
  1113. 2.   Hunt, James W. and McIlroy, M. D.,  "An  Algorithm  for
  1114.      Differential  File  Comparison,"  41, Computing Science
  1115.      Technical Report, Bell Laboratories, June 1976.
  1116.  
  1117. 3.   Rochkind, Marc J., "The Source  Code  Control  System,"
  1118.      IEEE  Transactions  on Software Engineering, vol. SE-1,
  1119.      no. 4, pp. 364-370, Dec. 1975.
  1120.  
  1121. 4.   Tichy, Walter F., "Design, Implementation, and  Evalua-
  1122.      tion  of  a Revision Control System," in Proceedings of
  1123.      the 6th International Conference on Software  Engineer-
  1124.      ing, pp. 58-67, ACM, IEEE, IPS, NBS, September 1982.
  1125.  
  1126. 5.   Leblang, David B. and Chase, Robert P., "Computer-Aided
  1127.      Software   Engineering  in  a  Distributed  Workstation
  1128.      Environment," SIGPLAN Notices,  vol.  19,  no.  5,  pp.
  1129.      104-112,    May   1984.    Proceedings   of   the   ACM
  1130.      SIGSOFT/SIGPLAN Software Engineering Symposium on Prac-
  1131.      tical Software Development Environments.
  1132.  
  1133. 6.   Glasser, Alan L., "The Evolution of a Source Code  Con-
  1134.      trol  System,"  Software Engineering Notes, vol. 3, no.
  1135.      5, pp. 122-125, Nov. 1978.  Proceedings of the Software
  1136.      Quality and Assurance Workshop.
  1137.  
  1138. 7.   Brown, H.B., "The Clear/Caster System," Nato Conference
  1139.      on Software Engineering, Rome, 1970.
  1140.  
  1141. 8.   Habermann, A. Nico, A Software Development Control Sys-
  1142.      tem,   Technical  Report,  Carnegie-Mellon  University,
  1143.      Department of Computer Science, Jan. 1979.
  1144.  
  1145. 9.   DEC, Code Management System, Digital Equipment Corpora-
  1146.      tion, 1982.  Document No. EA-23134-82
  1147.  
  1148. 10.  Lampson, Butler W. and Schmidt, Eric E., "Practical Use
  1149.      of  a Polymorphic Applicative Language," in Proceedings
  1150.      of the 10th  Symposium  on  Principles  of  Programming
  1151.      Languages, pp. 237-255, ACM, January 1983.
  1152.  
  1153. 11.  Tichy, Walter F., "A Data Model for Programming Support
  1154.      Environments  and  its Application," in Automated Tools
  1155.      for Information  System  Design  and  Development,  ed.
  1156.      Hans-Jochen  Schneider and Anthony I. Wasserman, North-
  1157.      Holland Publishing Company, Amsterdam, 1982.
  1158.  
  1159. 12.  Heckel, Paul, "A Technique  for  Isolating  Differences
  1160.      Between Files," Communications of the ACM, vol. 21, no.
  1161.      4, pp. 264-268, April 1978.
  1162.  
  1163. 13.  Tichy,  Walter  F.,  "The  String-to-String  Correction
  1164.      Problem with Block Moves," ACM Transactions on Computer
  1165.      Systems, vol. 2, no. 4, pp. 309-321, Nov. 1984.
  1166.  
  1167. _________________________
  1168.  
  1169.     An earlier version  of  this  paper  was  published
  1170. in Software--Practice  &  Experience 15, 7 (July 1985),
  1171. 637-654.
  1172.  
  1173.   - Pairs of RCS and  working  files  can  actually  be
  1174. specified  in  3  ways:  a) both are given, b) only the
  1175. working file is given, c) only the RCS file  is  given.
  1176. If  a pair is given, both files may have arbitrary path
  1177. prefixes; RCS commands pair them up intelligently.
  1178.  
  1179.   = Note that this problem is entirely  different  from
  1180. the atomicity problem.  Atomicity means that concurrent
  1181. update operations on the same RCS file cannot  be  per-
  1182. mitted,  because  that may result in inconsistent data.
  1183. Atomic updates are essential (and implemented in  RCS),
  1184. but do not solve the conflict discussed here.
  1185.  
  1186.   * This auto-checkout extension is available  only  in
  1187. some versions of MAKE, e.g. GNU MAKE.
  1188.  
  1189.   * The rcsclean and rcsfreeze  commands  are  optional
  1190. and are not always installed.
  1191.