xref: /openbsd/gnu/usr.bin/cvs/doc/RCSFILES (revision 2770ece5)
1780d15dfStholoIt would be nice for the RCS file format (which is implemented by a
2780d15dfSthologreat many tools, both free and non-free, both by calling GNU RCS and
3780d15dfStholoby reimplementing access to RCS files) were documented in some
4780d15dfStholostandard separate from any one tool.  But as far as I know no such
5780d15dfStholostandard exists.  Hence this file.
6780d15dfStholo
7780d15dfStholoThe place to start is the rcsfile.5 manpage in the GNU RCS 5.7
8780d15dfStholodistribution.  Then look at the diff at the end of this file (which
9780d15dfStholocontains a few fixes and clarifications to that manpage).
10780d15dfStholo
11780d15dfStholoIf you are interested in MKS RCS, src/ci.c in GNU RCS 5.7 has a
12780d15dfStholocomment about their date format.  However, as far as we know there
13780d15dfStholoisn't really any document describing MKS's changes to the RCS file
14780d15dfStholoformat.
15780d15dfStholo
16780d15dfStholoThe rcsfile.5 manpage does not document what goes in the "text" field
17780d15dfStholofor each revision.  The answer is that the head revision contains the
18780d15dfStholocontents of that revision and every other revision contain a bunch of
19780d15dfStholoedits to produce that revision ("a" and "d" lines).  The GNU diff
20780d15dfStholomanual (the version I looked at was for GNU diff 2.4) documents this
21780d15dfStholoformat somewhat (as the "RCS output format"), but the presentation is
22780d15dfStholoa bit confusing as it is all tangled up with the documentation of
23780d15dfStholoseveral other output formats.  If you just want some source code to
24780d15dfSthololook at, the part of CVS which applies these is RCS_deltas in
25780d15dfStholosrc/rcs.c.
26780d15dfStholo
27780d15dfStholoThe first time I read rcsfile.5 I didn't really notice the part about
28780d15dfStholothe order of the revisions.  This order _is_ important and CVS relies
29780d15dfStholoon it.  It is documented but it would be clearer if the example in
30780d15dfStholorcsfile.5 also showed the order of the revisions (and the "next" and
31780d15dfStholo"branch" fields and anything else where it would be useful to have an
32780d15dfStholoexample of how a revision tree is represented in an RCS file).
33780d15dfStholo
34780d15dfStholoThere is one case where CVS uses CVS-specific, non-compatible changes
35780d15dfStholoto the RCS file format, and this is magic branches.  See cvs.texinfo
36780d15dfStholofor more information on them.  CVS also sets the RCS state to "dead"
37780d15dfStholoto indicate that a file does not exist in a given revision (this is
38780d15dfStholostored just as any other RCS state is).
39780d15dfStholo
40*2770ece5StholoThe RCS file format allows quite a variety of extensions to be added
41*2770ece5Stholoin a compatible manner by use of the "newphrase" feature documented in
42*2770ece5Stholorcsfile.5.  We won't try to document extensions not used by CVS in any
43*2770ece5Stholodetail, but we will briefly list them.  Each occurrence of a newphrase
44*2770ece5Stholobegins with an identifier, which is what we list here.  Future
45*2770ece5Stholodesigners of extensions are strongly encouraged to pick
46*2770ece5Stholonon-conflicting identifiers.  Note that newphrase occurs several
47*2770ece5Stholoplaces in the RCS grammar, and a given extension may not be legal in
48*2770ece5Stholoall locations.  However, it seems better to reserve a particular
49*2770ece5Stholoidentifier for all locations, to avoid confusion and complicated
50*2770ece5Stholorules.
51*2770ece5Stholo
52*2770ece5Stholo   Identifier   Used by
53*2770ece5Stholo   ----------   -------
54*2770ece5Stholo   namespace    RCS library done at Silicon Graphics Inc. (SGI) in 1996
55*2770ece5Stholo                (a modified RCS 5.7--not sure it has any other name).
56*2770ece5Stholo   dead         A set of RCS patches developed by Rich Pixley at
57*2770ece5Stholo                Cygnus.  These were for CVS, and predated the current
58*2770ece5Stholo                CVS death support, which does not require RCS changes.
59*2770ece5Stholo
60b6c02222StholoThe rules regarding keyword expansion are not documented along with
61b6c02222Stholothe rest of the RCS file format; they are documented in the co(1)
62b6c02222Stholomanpage in the RCS 5.7 distribution.  See also the "Keyword
63b6c02222Stholosubstitution" chapter of cvs.texinfo.  The co(1) manpage refers to
64b6c02222Stholospecial behavior if the log prefix for the $Log keyword is /* or (*.
65b6c02222StholoRCS 5.7 produces a warning whenever it behaves that way, and current
66b6c02222Stholoversions of CVS do not handle this case in a special way (CVS 1.9 and
67b6c02222Stholoearlier invoke RCS to perform keyword expansion).
68b6c02222Stholo
69b6c02222StholoNote that the "comment {string};" syntax from rcsfile.5 specifies a
70b6c02222Stholocomment leader, which affects expansion of the $Log keyword for old
71b6c02222Stholoversions of RCS.  The comment leader is not used by RCS 5.7 or current
72b6c02222Stholoversions of CVS.
73b6c02222Stholo
74b6c02222StholoBoth RCS 5.7 and current versions of CVS handle the $Log keyword in a
75b6c02222Stholodifferent way if the log message starts with "checked in with -k by ".
76b6c02222StholoI don't think this behavior is documented anywhere.
77b6c02222Stholo
78*2770ece5StholoOne common concern about the RCS file format is the fact that to get
79*2770ece5Stholothe head of a branch, one must apply deltas from the head of the trunk
80*2770ece5Stholoto the branchpoint, and then from the branchpoint to the head of the
81*2770ece5Stholobranch.  While more detailed analyses might be worth doing, we will
82*2770ece5Stholonote:
83*2770ece5Stholo
84*2770ece5Stholo    * The performance bottleneck for CVS generally is figuring out which
85*2770ece5Stholo    files to operate on and that sort of thing, not applying deltas.
86*2770ece5Stholo
87*2770ece5Stholo    * Here is one quick test (probably not a very good test; a better test
88*2770ece5Stholo    would use a normally sized file (say 50-200K) instead of a small one):
89*2770ece5Stholo
90*2770ece5Stholo	I just did a quick test with a small file (on a Sun Ultra 1/170E
91*2770ece5Stholo	running Solaris 5.5.1), with 1000 revisions on the main branch and
92*2770ece5Stholo	1000 revisions on branch that forked at the root (i.e., RCS revisions
93*2770ece5Stholo	1.1, 1.2, ..., 1.1000, and branch revisions 1.1.1.1, 1.1.1.2, ...,
94*2770ece5Stholo	1.1.1.1000).  It took about 0.15 seconds real time to check in the
95*2770ece5Stholo	first revision, and about 0.6 seconds to check in and 0.3 seconds to
96*2770ece5Stholo	retrieve revision 1.1.1.1000 (the worst case).
97*2770ece5Stholo
98*2770ece5Stholo    * Any attempt to "fix" this problem should be careful not to interfere
99*2770ece5Stholo    with other features, such as lightweight creation of branches
100*2770ece5Stholo    (particularly using CVS magic branches).
101*2770ece5Stholo
102780d15dfStholoDiff follows:
103780d15dfStholo
104780d15dfStholo(Note that in the following diff the old value for the Id keyword was:
105780d15dfStholo    Id: rcsfile.5in,v 5.6 1995/06/05 08:28:35 eggert Exp
106780d15dfStholoand the new one was:
107780d15dfStholo    Id: rcsfile.5in,v 5.7 1996/12/09 17:31:44 eggert Exp
108780d15dfStholobut since this file itself might be subject to keyword expansion I
109780d15dfStholohaven't included a diff for that fact).
110780d15dfStholo
111780d15dfStholo===================================================================
112780d15dfStholoRCS file: RCS/rcsfile.5in,v
113780d15dfStholoretrieving revision 5.6
114780d15dfStholoretrieving revision 5.7
115780d15dfStholodiff -u -r5.6 -r5.7
116780d15dfStholo--- rcsfile.5in	1995/06/05 08:28:35	5.6
117780d15dfStholo+++ rcsfile.5in	1996/12/09 17:31:44	5.7
118780d15dfStholo@@ -85,7 +85,8 @@
119780d15dfStholo .LP
120780d15dfStholo \f2sym\fP	::=	{\f2digit\fP}* \f2idchar\fP {\f2idchar\fP | \f2digit\fP}*
121780d15dfStholo .LP
122780d15dfStholo-\f2idchar\fP	::=	any visible graphic character except \f2special\fP
123780d15dfStholo+\f2idchar\fP	::=	any visible graphic character,
124780d15dfStholo+		except \f2digit\fP or \f2special\fP
125780d15dfStholo .LP
126780d15dfStholo \f2special\fP	::=	\f3$\fP | \f3,\fP | \f3.\fP | \f3:\fP | \f3;\fP | \f3@\fP
127780d15dfStholo .LP
128780d15dfStholo@@ -119,12 +120,23 @@
129780d15dfStholo the minute (00\-59),
130780d15dfStholo and
131780d15dfStholo .I ss
132780d15dfStholo-the second (00\-60).
133780d15dfStholo+the second (00\-59).
134780d15dfStholo+If
135780d15dfStholo .I Y
136780d15dfStholo-contains just the last two digits of the year
137780d15dfStholo-for years from 1900 through 1999,
138780d15dfStholo-and all the digits of years thereafter.
139780d15dfStholo-Dates use the Gregorian calendar; times use UTC.
140780d15dfStholo+contains exactly two digits,
141780d15dfStholo+they are the last two digits of a year from 1900 through 1999;
142780d15dfStholo+otherwise,
143780d15dfStholo+.I Y
144780d15dfStholo+contains all the digits of the year.
145780d15dfStholo+Dates use the Gregorian calendar.
146780d15dfStholo+Times use UTC, except that for portability's sake leap seconds are not allowed;
147780d15dfStholo+implementations that support leap seconds should output
148780d15dfStholo+.B 59
149780d15dfStholo+for
150780d15dfStholo+.I ss
151780d15dfStholo+during an inserted leap second, and should accept
152780d15dfStholo+.B 59
153780d15dfStholo+for a deleted leap second.
154780d15dfStholo .PP
155780d15dfStholo The
156780d15dfStholo .I newphrase
157780d15dfStholo@@ -144,16 +156,23 @@
158780d15dfStholo field in order of decreasing numbers.
159780d15dfStholo The
160780d15dfStholo .B head
161780d15dfStholo-field in the
162780d15dfStholo-.I admin
163780d15dfStholo-node points to the head of that sequence (i.e., contains
164780d15dfStholo+field points to the head of that sequence (i.e., contains
165780d15dfStholo the highest pair).
166780d15dfStholo The
167780d15dfStholo .B branch
168780d15dfStholo-node in the admin node indicates the default
169780d15dfStholo+field indicates the default
170780d15dfStholo branch (or revision) for most \*r operations.
171780d15dfStholo If empty, the default
172780d15dfStholo branch is the highest branch on the trunk.
173780d15dfStholo+The
174780d15dfStholo+.B symbols
175780d15dfStholo+field associates symbolic names with revisions.
176780d15dfStholo+For example, if the file contains
177780d15dfStholo+.B "symbols rr:1.1;"
178780d15dfStholo+then
179780d15dfStholo+.B rr
180780d15dfStholo+is a name for revision
181780d15dfStholo+.BR 1.1 .
182780d15dfStholo .PP
183780d15dfStholo All
184780d15dfStholo .I delta
185780d15dfStholo
186