Debian Codegraph @

texmf-dist/source/latex/rcs/src/rcs-user.tex

raw
1 % $DocId: rcs-user.tex,v 1.9 1995/08/02 12:08:41 schrod Exp $
2 %------------------------------------------------------------
3
4 %
5 % user manual/requirement definition for rcs package
6 %
7 % [LaTeX]
8 % (history somewhere inmidst, search for RCS DocLog field)
9
10
11 % This file is either a subdocument of the package or a document on
12 % its own. In the former case it's a chapter, in the latter it's a
13 % ``normal'' LaTeX progltx document.
14 % If it's a subdocument, this file will be included after
15 % \begin{document}. We can detect this: \document redefines
16 % \documentclass to be \@twoclasseserror. Then we also have to define
17 % how this document is ended: Either by \endinput or by \end{document}.
18 % Of course, this test works only if LaTeX 2e is used for processing.
19
20 \expandafter\ifx \csname @twoclasseserror\endcsname \documentclass
21
22 \let\endDocument\endinput
23
24 \chap What's this package for?.
25
26 \else
27
28 \def\endDocument{\end{document}}
29
30 \documentclass{progltx}
31
32 \usepackage{rcs-doc} % addition document-specific markup
33 \usepackage{a4-9} % Tschichold's A4 layout
34
35 \nofiles
36
37 \begin{document}
38
39 \title{The \texttt{rcs} Package}
40 \author{Joachim Schrod%
41 \thanks{Email: \texttt{[email protected]}}%
42 }
43
44 \RCS $DocDate: 1995/08/02 12:08:41 $
45 \date{%
46 \RCSDocDate\\[3pt] % LaTeX Error: Paragraph terminated too early
47 (Revision \RCSStyleRevision{} of \texttt{rcs.sty})%
48 }
49
50 \maketitle
51
52 \sect
53
54 \fi
55
56
57 An important problem in program development and maintenance is version
58 control, i.e., the task of keeping a software system consisting of
59 many versions and configurations well organized. The \textsl{Revision
60 Control System} (RCS) is a software tool that assists with that
61 task. RCS manages revisions of text documents, in particular source
62 programs, documentation, and test data. It automates storing,
63 retrieval, logging and identification of revisions, and it provides
64 selection mechanisms for composing configurations. In addition, it is
65 able to insert management information in the text document, in
66 so-called \textsl{RCS fields}.
67
68 The \textsl{Concurrent Versions System} (CVS) is a front end to RCS
69 which extends the notion of revision control from a collection of
70 files in a single directory to a hierarchical collection of
71 directories consisting of revision-controlled files. These
72 directories and files can be combined to form a software
73 release. CVS provides the functions necessary to manage these
74 software releases and to control the concurrent editing of source
75 files among multiple software developers.
76
77
78 \sect If you put \LaTeX{} documents under RCS control, you'll often want to
79 have access to the data of the RCS fields within your document, e.g.,
80 to put the date of the last checkin, the revision number, or the
81 author's name in your document. This package provides \TeX{}
82 tags that give you access to this information. In addition, using a
83 configurable RCS, you can typeset your revision logs.
84
85
86 \sect There is one restriction: If you checked out with the |-kv|
87 option, you cannot \LaTeX{} your document any more. You'll get an
88 error then. If you're a CVS user, the same holds for the `|cvs export|'
89 command. (Actually, this is equivalent to `|co -kv|'.) This
90 would discard the dollars and all keywords from the RCS fields; the
91 tags explained below need the keywords to work properly.
92
93 If you have any idea how a tag might look which circumvents this
94 problem, contact me. (I'm not asking for an implementation, I'm asking for an
95 idea for a user interface!) E.g., are you hit by this problem, and are
96 you willing to enter an additional argument with the keyword for each
97 RCS field?
98
99 \medskip
100
101 This package assumes the file naming possibilities of Unix. It does not
102 work without changes on systems with a restricted file name syntax,
103 like MS-DOS, VMS, etc. In particular, it assumes that RCS uses~`|,v|'
104 as the suffix for its files, as it's the default.
105
106
107 \sect Let's first consider the access to the values of RCS
108 fields. By writing
109 %
110 \begin{quote}
111 |\RCS $|\textit{Keyword}|$|
112 \end{quote}
113 %
114 in your document, a tag
115 %
116 \begin{quote}
117 |\RCS|\textit{Keyword}
118 \end{quote}
119 %
120 is created which expands to the value of the field with this
121 respective keyword. E.g., if you write |\RCS $Revision: 1.10 $| and you
122 check in your document, RCS will transform this to something like
123 |\RCS $Revision: 1.10 $| and you can access the revision of your
124 document as |\RCSRevision|. This will expand to~`1.1' (note that the
125 trailing space was discarded).
126
127 Of course, an RCS field has a value only if you have checked in your
128 file at least once after you inserted it. If the field is brand new,
129 the constructed \TeX{} tag expands to nothing.%
130 \footnote{Well, not quite exactly---this can be changed. Refer to
131 the documentation of the style's internal (programmer's) interface.}
132
133
134 \sect The \Date{} field is handled in a slightly different manner: Here
135 |\RCSDate| doesn't expand to the original RCS value, it's transformed
136 first. The expansion is the checkin date in a |\today|-like format.
137 The checkin time is available via |\RCSTime| then.
138
139 If the \Date{} value is empty, |\RCSDate| will expand to the
140 current date and |\RCSTime| will expand to nothing.
141
142 The ``original'' \Date{} value is stored in |\RCSRawDate|. This whole
143 transformation is done only if the tag |\today| is defined (which is
144 the case for all standard classes).
145
146
147
148 \sect \textsl{Tags for your convenience}.
149
150 \medskip
151
152 \noindent |\RCS| puts information from RCS fields into \TeX{} tags.
153 Some usages of such values are wanted more often than others: placing
154 the checkin date on the title page, and placing the field keyword and
155 value in a footline. This was made available in other |rcs| style options;
156 we use the tag names from there for the sake of compatibility.
157
158
159 \sect The tag |\RCSdate| (with a lowercase~`d') is a convenient
160 way to put the last checkin date on the title page. It's used instead
161 of |\date| and expects an RCS \Date{} field afterwards; i.e., to be
162 input as
163 %
164 \begin{quote}
165 |\RCSdate $Date: 2003/02/02 22:30:22 $|
166 \end{quote}
167 %
168 Afterwards |\maketitle| will use the checkin date.
169
170 In fact, the \Date{} value is still placed in |\RCSDate| (with an
171 uppercase~`D') and this tag is used as the argument for |\date|.
172 I.e., this is identical to writing
173 %
174 \begin{quote}
175 |\RCS $Date: 2003/02/02 22:30:22 $|\\
176 |\date{\RCSDate}|
177 \end{quote}
178
179
180 \sect The tag |\RCSID| places the keyword and the value of the RCS
181 field in a box into the footline. The RCS field is expected after the
182 tag. The value is not transformed---you'll see it exactly as RCS
183 inserted it. Aside from this, |\RCSID| has the same effect as |\RCS|:
184 The field value is stored in |\RCS|\textit{Keyword}.
185
186 \textbf{Note:}\quad If you use this tag, you cannot use any other page
187 style or package that sets the footline! The RCS field value must not
188 be a file name with underscores, you get \TeX{} errors otherwise.
189
190
191 \sect The tag |\RCSdef| is like |\RCS|, but it additionally outputs
192 the RCS field to the terminal. (As with everything output to the
193 terminal, it will be in the |LOG| file, too.) The RCS field value must
194 not be a file name with underscores, you get \TeX{} errors otherwise.
195
196
197
198 \sect \textsl{Typesetting revision logs}.
199
200 \medskip
201
202 \noindent RCS creates a revision log (sometimes also called change
203 log, version history, etc.)\ in the lines below a \Log{} field. When
204 one's \LaTeX{} document is really a program (e.g., if one uses a
205 system of the WEB family like \texttt{CWEB} or noweb, or if one
206 uses a documentation system \`a la MAKEPROG), one might want to
207 incorporate such a log in the typeset document. This is strongly
208 encouraged for every literate program---the version history is an
209 integral part of a program's documentation.
210
211 This package provides an environment |rcslog| which supports the
212 typesetting of logs. But you cannot use it with a normal RCS version.
213 You need to be able to configure the format of a revision entry. We
214 have created such a configurable version, you can retrieve it by
215 anonymous ftp from
216 \path|ftp.tu-darmstadt.de:pub/programming/management/confrcs|. (We
217 welcome comments and bug reports.)
218
219 Since version 1.10, CVS has its own internal RCS implementation,
220 therefore you cannot typeset revision logs with CVS, sorry. Please
221 contact me if you find a way nevertheless.
222
223
224 \sect You must create an RCS configuration file |.rcsrc| where a
225 backslash is prepended to the revision entries. I.e., it must contain
226 the following configuration line:
227 %
228 \begin{quote}
229 |log_entry "\\Revision %r %d %t %a\n%l\n"|
230 \end{quote}
231 %
232 This line changes the format of revision entries for \emph{every}
233 file in your directory. If you want to have this special entry format
234 only for specific files, you can put a guard in front of this
235 configuration: the filename and a colon. You can also use wildcards
236 in the filename. For example, to change the entry format for all
237 files with the suffix |doc| use
238 %
239 \begin{quote}
240 |*.doc: log_entry "\\Revision %r %d %t %a\n%l\n"|
241 \end{quote}
242 %
243 The configurable RCS gives you more possibilities, refer to its
244 documentation.
245
246
247 \sect The |rcslog| environment needs the \Log{} field as the first
248 line, there must be no material either before or behind it. If you
249 just create a new document, you simply input the three lines
250 %
251 \begin{quote}
252 \begin{verbatim}
253 \begin{rcslog}
254 $Log: rcs-user.tex,v $
255 Revision 1.10 2003/02/02 22:30:22 schrod
256 Removed dependeny on \LaTeX2.09 font selection commands. (Though
257 they're still used in the package documentation, as convenience.)
258
259 \end{rcslog}
260 \end{verbatim}
261 \end{quote}
262 %
263 (Note that the configurable RCS will now set the comment leader to the
264 empty string, which is exactly the value we need.)
265
266 If you have checked in your document already once and if you don't
267 have a revision log by now, you still insert the three lines listed
268 above. Then you have to set the comment leader to the empty string.
269 If you don't have a WIMP interface to RCS, you do this with the
270 command `|rcs -c |\textit{filename}'.
271 %With CVS, you use the command
272 %`|cvs admin -c |\textit{filename}'.
273
274 If you have checked in your document already and if you already have a
275 revision log, you insert the environment start
276 (|\begin{rcslog}|) in a new line before the \Log{} field and
277 |\end{rcslog}| below the entries. Usually all lines from the revision
278 log will be prefixed with a comment, delete this prefix from each
279 line. Each revision entry starts with `|Revision|', change this to
280 `|\Revision|'. Check that your log texts are valid \LaTeX{} input.
281 Set the comment leader to the empty string (this is described in the
282 previous paragraph). Voil\`a, you're finished---welcome to the
283 community of Literate Programmers!
284
285
286 \sect And since the description of this functionality might have been
287 a bit dry, I want to show you the output you get usually: I insert
288 here the log of this user manual. In fact, it was created by the
289 method described in the previous paragraph---the capability of
290 typesetting revision logs was not available from the very start.
291
292 \begin{rcslog}
293 $DocLog: rcs-user.tex,v $
294 \Revision 1.9 1995/08/02 12:08:41 schrod
295 Transformed this style option into a \LaTeXe{} package.
296
297 \Revision 1.8 1995/08/01 21:02:14 schrod
298 Adapted to \LaTeXe{}. Spell checked.
299
300 \Revision 1.7 1993/11/10 12:26:56 schrod
301 barbara proofread the user manual. Besides her minor changes she
302 asked what RCS and CVS are, and if this can be used somewhere else
303 than on Unix. I added appropriate paragraphs to explain the tools.
304 Actually, the package may be used only on Unix, due to the dependency
305 on the `|,v|' filename suffix.
306
307 \Revision 1.6 1993/11/03 20:04:23 schrod
308 Cleaned up for distribution: Added email address to each document,
309 added copyright info to |rcs.doc|, added acknowledgments. Checked my
310 English and the spacing.
311
312 Explained the restriction concerning the |-kv| option of |co|.
313
314 \Revision 1.5 1993/11/02 20:02:29 schrod
315 Introduced new tag |\RCSdef|. This is done to be upward compatible with
316 Tom Verhoeff's |rcs| style option.
317
318 \Revision 1.4 1993/11/02 18:43:19 schrod
319 Introduced new tag |\RCSID|. This is done to be upward compatible with
320 Nelson's |rcs| style option.
321
322 \Revision 1.3 1993/11/01 19:54:08 schrod
323 Added a description of the internal interface, I can refer now to
324 that description. (Previously, I refered to the style's documentation.)
325
326 Don't create auxiliary files, we don't need them.
327
328 \Revision 1.2 1993/11/01 19:21:22 schrod
329 Explained the new feature of typesetting logs. This includes the user
330 manual's log as an example.
331
332 Improved the documentation. Told first what happens, then the
333 exceptions. Used ``pseudo section headings'' to give visual clues for
334 the structure.
335
336 Added the style's revision number to the title page.\\
337 Used |rcs-doc.sty| for documentation of |rcs| style. It not only
338 loads style options, but it also defines |\RCSStyleRevision| for
339 access of the style's revision.
340
341 Prefixed keywords of RCS fields with `|Doc|'. This way we can use the
342 normal keywords in examples and don't have to care about
343 non-expansion.
344
345 \Revision 1.1 1993/09/03 21:01:28 schrod
346 Re-implemented |rcs| style option. Made it a documented option.
347
348 \end{rcslog}
349
350
351 \sect Nearly every detail of the formatting of the log is done by
352 macros that can be changed, refer to the documentation of the style's
353 internal interface for more information.
354
355 In particular, the |rcslog| environment accepts an optional argument,
356 the configuration. Here \LaTeX{} code is expected, which is inserted
357 after the initial setup, before the heading is set. E.g., this is the
358 place for you to change the type size. (Although this should be done
359 with care---you'll also have to change the heading to get a consistent
360 layout.)
361
362 In addition, the tag |\settime| may be used in this optional argument
363 to add the checkin time to all revision entries. (Longtime RCS users
364 will have noticed already that it was omitted.) This tag---as well
365 as |\Revision|---is not defined outside the environment.
366
367
368 \sect Longtime RCS users will have noticed another fine point in the
369 log presented above: My full name was presented, not my user id
370 (actually, `|schrod|'). This was done by placing the tag
371 %
372 \begin{quote}
373 |\rcsAuthor{schrod}{Joachim Schrod}|
374 \end{quote}
375 %
376 somewhere before the log. Of course, if no full name has been
377 presented for a user id, the user id itself is used as the author's
378 name.
379
380
381 \sect As explained above, one can configure the layout with an
382 optional argument of the environment. (Or by redefining macros from
383 the style writer's interface in another style option.) What's wanted
384 sometimes are some introductionary words to the log; this can't be
385 done easily this way. (Remember, the heading is not typeset yet.)
386 Therefore, we provide a tag for this obvious need.
387
388 The introductionary text can be specified as the parameter of the tag
389 |\rcsLogIntro|. It will be inserted after the heading, before the
390 \Log{} list.
391
392
393
394 \sect \textsl{Compatibility issues}.
395
396 \medskip
397
398 \noindent This package is user interface compatible to \textsc{Piet van
399 Oostrum}'s |rcs| style option. The internal interface of Piet's style
400 option is not supported; check the documentation of this package's
401 internal interface for its own internal configuration possibilities.
402
403 This package is user interface compatible to \textsc{Nelson Beebe}'s |rcs|
404 style option. But it does not set the footline unconditionally.
405
406 This package is user interface compatible to \textsc{Tom Verhoeff}'s |rcs|
407 style option. (Well, the text output by |\RCSdef| is not identical.)
408
409 And, of course, it's upward compatible to previous revisions\,\dots
410
411
412
413 \endDocument
414
415 % LocalWords: checkin kv cvs co rcslog confrcs rcsrc doc rcs admin Voil Piet
416 % LocalWords: proofread Verhoeff's Nelson's Oostrum Piet's Verhoeff