home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / rcstxi11.zip / rcstexi.110 / rcsintro.tex < prev    next >
Text File  |  1997-03-30  |  13KB  |  350 lines

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