1CO(1)                       General Commands Manual                      CO(1)
2
3
4

NAME

6       co - check out RCS revisions
7

SYNOPSIS

9       co [options] file ...
10

DESCRIPTION

12       co  retrieves a revision from each RCS file and stores it into the cor‐
13       responding working file.
14
15       Filenames matching an RCS suffix denote RCS files;  all  others  denote
16       working files.  Names are paired as explained in ci(1).
17
18       Revisions  of an RCS file can be checked out locked or unlocked.  Lock‐
19       ing a revision prevents overlapping updates.  A  revision  checked  out
20       for  reading  or  processing  (e.g.,  compiling) need not be locked.  A
21       revision checked out for editing and later  checkin  must  normally  be
22       locked.   Checkout with locking fails if the revision to be checked out
23       is currently locked by another  user.   (A  lock  can  be  broken  with
24       rcs(1).)   Checkout  with locking also requires the caller to be on the
25       access list of the RCS file, unless he is the owner of the file or  the
26       superuser,  or  the  access list is empty.  Checkout without locking is
27       not subject to accesslist restrictions, and  is  not  affected  by  the
28       presence of locks.
29
30       A  revision  is  selected  by  options  for  revision or branch number,
31       checkin date/time, author, or state.  When the  selection  options  are
32       applied in combination, co retrieves the latest revision that satisfies
33       all of them.  If  none  of  the  selection  options  is  specified,  co
34       retrieves  the  latest  revision  on  the  default branch (normally the
35       trunk, see the -b option of rcs(1)).  A revision or branch  number  can
36       be  attached  to  any of the options -f, -I, -l, -M, -p, -q, -r, or -u.
37       The options -d (date), -s (state), and -w (author) retrieve from a sin‐
38       gle  branch,  the  selected branch, which is either specified by one of
39       -f, ..., -u, or the default branch.
40
41       A co command applied to an RCS file with no revisions creates  a  zero-
42       length  working  file.   co  always  performs keyword substitution (see
43       below).
44

OPTIONS

46       -r[rev]
47              retrieves the latest revision whose number is less than or equal
48              to  rev.   If rev indicates a branch rather than a revision, the
49              latest revision on that branch is retrieved.  If rev is omitted,
50              the  latest revision on the default branch (see the -b option of
51              rcs(1)) is retrieved.  If rev is $, co determines  the  revision
52              number  from  keyword  values in the working file.  Otherwise, a
53              revision is composed of one or more numeric or  symbolic  fields
54              separated  by  periods.   If  rev begins with a period, then the
55              default branch (normally the trunk) is prepended to it.  If  rev
56              is  a  branch number followed by a period, then the latest revi‐
57              sion on that branch is used.  The numeric equivalent of  a  sym‐
58              bolic  field  is  specified  with  the -n option of the commands
59              ci(1) and rcs(1).
60
61       -l[rev]
62              same as -r, except that it also locks the retrieved revision for
63              the caller.
64
65       -u[rev]
66              same  as -r, except that it unlocks the retrieved revision if it
67              was locked by the caller.  If rev is omitted, -u  retrieves  the
68              revision  locked  by  the caller, if there is one; otherwise, it
69              retrieves the latest revision on the default branch.
70
71       -f[rev]
72              forces the overwriting of the working file; useful in connection
73              with -q.  See also FILE MODES below.
74
75       -kkv   Generate keyword strings using the default form, e.g. $Revision:
76              5.10.0 $ for the Revision keyword.  A locker's name is  inserted
77              in  the value of the Header, Id, and Locker keyword strings only
78              as a file is being locked, i.e. by ci -l and co -l.  This is the
79              default.
80
81       -kkvl  Like -kkv, except that a locker's name is always inserted if the
82              given revision is currently locked.
83
84       -kk    Generate only keyword names in keyword strings; omit their  val‐
85              ues.   See  KEYWORD  SUBSTITUTION  below.   For example, for the
86              Revision keyword, generate  the  string  $Revision$  instead  of
87              $Revision:  5.10.0  $.   This option is useful to ignore differ‐
88              ences due to keyword substitution when comparing different revi‐
89              sions of a file.  Log messages are inserted after $Log$ keywords
90              even if -kk is specified, since this tends  to  be  more  useful
91              when merging changes.
92
93       -ko    Generate  the  old  keyword  string, present in the working file
94              just before it was checked in.  For example,  for  the  Revision
95              keyword,  generate the string $Revision: 1.1 $ instead of $Revi‐
96              sion: 5.10.0 $ if that is how the string appeared when the  file
97              was checked in.  This can be useful for file formats that cannot
98              tolerate any changes to substrings that happen to take the  form
99              of keyword strings.
100
101       -kb    Generate  a  binary  image of the old keyword string.  This acts
102              like -ko, except it performs all working file input  and  output
103              in  binary mode.  This makes little difference on Posix and Unix
104              hosts, but on DOS-like hosts one should use rcs -i -kb  to  ini‐
105              tialize an RCS file intended to be used for binary files.  Also,
106              on all hosts, rcsmerge(1) normally refuses to merge  files  when
107              -kb is in effect.
108
109       -kv    Generate  only keyword values for keyword strings.  For example,
110              for the Revision keyword, generate the string 5.10.0 instead  of
111              $Revision:  5.10.0  $.  This can help generate files in program‐
112              ming languages where it is hard to strip keyword delimiters like
113              $Revision: $  from a string.  However, further keyword substitu‐
114              tion cannot be performed once the keyword names are removed,  so
115              this option should be used with care.  Because of this danger of
116              losing keywords, this option cannot be combined with -l, and the
117              owner  write  permission  of  the working file is turned off; to
118              edit the file later, check it out again without -kv.
119
120       -p[rev]
121              prints the retrieved revision on the standard output rather than
122              storing  it  in the working file.  This option is useful when co
123              is part of a pipe.
124
125       -q[rev]
126              quiet mode; diagnostics are not printed.
127
128       -I[rev]
129              interactive mode; the user is prompted and  questioned  even  if
130              the standard input is not a terminal.
131
132       -ddate retrieves  the  latest  revision  on  the  selected branch whose
133              checkin date/time is less than or equal to date.  The  date  and
134              time  can  be given in free format.  The time zone LT stands for
135              local time; other common time zone names  are  understood.   For
136              example,  the  following  dates  are equivalent if local time is
137              January 11, 1990, 8pm Pacific Standard Time, eight hours west of
138              Coordinated Universal Time (UTC):
139
140                     8:00 pm lt
141                     4:00 AM, Jan. 12, 1990           default is UTC
142                     1990-01-12 04:00:00+00           ISO 8601 (UTC)
143                     1990-01-11 20:00:00-08           ISO 8601 (local time)
144                     1990/01/12 04:00:00              traditional RCS format
145                     Thu Jan 11 20:00:00 1990 LT      output of ctime(3) + LT
146                     Thu Jan 11 20:00:00 PST 1990     output of date(1)
147                     Fri Jan 12 04:00:00 GMT 1990
148                     Thu, 11 Jan 1990 20:00:00 -0800  Internet RFC 822
149                     12-January-1990, 04:00 WET
150
151              Most  fields in the date and time can be defaulted.  The default
152              time zone is normally UTC, but this can be overridden by the  -z
153              option.   The  other  defaults are determined in the order year,
154              month, day, hour, minute, and second  (most  to  least  signifi‐
155              cant).   At  least  one  of  these fields must be provided.  For
156              omitted fields that are of higher significance than the  highest
157              provided field, the time zone's current values are assumed.  For
158              all  other  omitted  fields,  the  lowest  possible  values  are
159              assumed.   For  example, without -z, the date 20, 10:30 defaults
160              to 10:30:00 UTC of the 20th of the UTC time zone's current month
161              and year.  The date/time must be quoted if it contains spaces.
162
163       -M[rev]
164              Set the modification time on the new working file to be the date
165              of the retrieved revision.  Use this option with  care;  it  can
166              confuse make(1).
167
168       -sstate
169              retrieves the latest revision on the selected branch whose state
170              is set to state.
171
172       -S     Enable self-same mode.  In this mode, the owner  of  a  lock  is
173              unimportant,  just  that it exists.  Effectively, this means the
174              user cannot check out the same revision twice.
175
176       -T     Preserve the modification time on the RCS file even if  the  RCS
177              file  changes  because  a lock is added or removed.  This option
178              can suppress extensive recompilation caused by a make(1)  depen‐
179              dency  of  some  other copy of the working file on the RCS file.
180              Use this option with care; it can  suppress  recompilation  even
181              when  it  is  needed,  i.e. when the change of lock would mean a
182              change to keyword strings in the other working file.
183
184       -w[login]
185              retrieves the latest revision on the selected branch  which  was
186              checked  in  by the user with login name login.  If the argument
187              login is omitted, the caller's login is assumed.
188
189       -jjoinlist
190              generates a new revision which is the join of the  revisions  on
191              joinlist.   This  option is largely obsoleted by rcsmerge(1) but
192              is retained for backwards compatibility.
193
194              The joinlist is a comma-separated list  of  pairs  of  the  form
195              rev2:rev3,  where  rev2 and rev3 are (symbolic or numeric) revi‐
196              sion numbers.  For the initial such pair, rev1 denotes the revi‐
197              sion  selected  by the above options -f, ..., -w.  For all other
198              pairs, rev1 denotes the revision generated by the previous pair.
199              (Thus, the output of one join becomes the input to the next.)
200
201              For  each pair, co joins revisions rev1 and rev3 with respect to
202              rev2.  This means that all changes that transform rev2 into rev1
203              are  applied  to a copy of rev3.  This is particularly useful if
204              rev1 and rev3 are the ends of two branches that have rev2  as  a
205              common  ancestor.  If rev1<rev2<rev3 on the same branch, joining
206              generates a new revision  which  is  like  rev3,  but  with  all
207              changes  that  lead  from  rev1 to rev2 undone.  If changes from
208              rev2 to rev1 overlap with changes from rev2 to rev3, co  reports
209              overlaps as described in merge(1).
210
211              For  the  initial pair, rev2 can be omitted.  The default is the
212              common ancestor.  If any of the arguments indicate branches, the
213              latest  revisions on those branches are assumed.  The options -l
214              and -u lock or unlock rev1.
215
216       -V     Print RCS's version number.
217
218       -Vn    Emulate RCS version n, where n can be 3, 4, or 5.  This  can  be
219              useful  when interchanging RCS files with others who are running
220              older versions of RCS.  To see which version of RCS your  corre‐
221              spondents  are running, have them invoke rcs -V; this works with
222              newer versions of RCS.  If it doesn't  work,  have  them  invoke
223              rlog  on  an  RCS file; if none of the first few lines of output
224              contain the string branch: it is version 3; if the dates'  years
225              have  just two digits, it is version 4; otherwise, it is version
226              5.  An RCS file generated while emulating version  3  loses  its
227              default  branch.  An RCS revision generated while emulating ver‐
228              sion 4 or earlier has a time stamp that  is  off  by  up  to  13
229              hours.   A  revision extracted while emulating version 4 or ear‐
230              lier contains abbreviated dates of the  form  yy/mm/dd  and  can
231              also contain different white space and line prefixes in the sub‐
232              stitution for $Log$.
233
234       -xsuffixes
235              Use suffixes to characterize RCS files.  See ci(1) for details.
236
237       -zzone specifies the date output format in  keyword  substitution,  and
238              specifies  the  default time zone for date in the -ddate option.
239              The zone should be empty, a numeric UTC offset, or  the  special
240              string  LT  for local time.  The default is an empty zone, which
241              uses the traditional RCS format of UTC  without  any  time  zone
242              indication  and  with  slashes separating the parts of the date;
243              otherwise, times are output in ISO 8601 format  with  time  zone
244              indication.  For example, if local time is January 11, 1990, 8pm
245              Pacific Standard Time, eight hours west of UTC, then the time is
246              output as follows:
247
248                     option    time output
249                     -z        1990/01/12 04:00:00        (default)
250                     -zLT      1990-01-11 20:00:00-08
251                     -z+05:30  1990-01-12 09:30:00+05:30
252
253              The  -z  option does not affect dates stored in RCS files, which
254              are always UTC.
255

KEYWORD SUBSTITUTION

257       Strings of the form $keyword$ and $keyword:...$ embedded  in  the  text
258       are replaced with strings of the form $keyword:value$ where keyword and
259       value are pairs listed below.  Keywords  can  be  embedded  in  literal
260       strings or comments to identify a revision.
261
262       Initially, the user enters strings of the form $keyword$.  On checkout,
263       co replaces these strings with strings of the form $keyword:value$.  If
264       a  revision  containing  strings of the latter form is checked back in,
265       the value fields will be replaced during the next checkout.  Thus,  the
266       keyword  values  are automatically updated on checkout.  This automatic
267       substitution can be modified by the -k options.
268
269       Keywords and their corresponding values:
270
271       $Author$
272              The login name of the user who checked in the revision.
273
274       $Date$ The date and time the revision was checked in.   With  -zzone  a
275              numeric  time  zone  offset  is appended; otherwise, the date is
276              UTC.
277
278       $Header$
279              A standard header containing the full RCS file name,  the  revi‐
280              sion  number,  the date and time, the author, the state, and the
281              locker (if locked).  With -zzone a numeric time zone  offset  is
282              appended to the date; otherwise, the date is UTC.
283
284       $Id$   Same  as  $Header$, except that the RCS file name is without the
285              directory components.
286
287       $Locker$
288              The login name of the user who locked the revision (empty if not
289              locked).
290
291       $Log$  The  log  message  supplied during checkin, preceded by a header
292              containing the RCS file name, the revision number,  the  author,
293              and  the  date and time.  With -zzone a numeric time zone offset
294              is appended; otherwise, the date is UTC.  Existing log  messages
295              are  not  replaced.   Instead,  the  new log message is inserted
296              after $Log:...$.  This is useful  for  accumulating  a  complete
297              change log in a source file.
298
299              Each  inserted  line is prefixed by the string that prefixes the
300              $Log$ line.   For  example,  if  the  $Log$  line  is  “// $Log:
301              tan.cc $”,  RCS  prefixes each line of the log with “// ”.  This
302              is useful for languages with comments that go to the end of  the
303              line.  The convention for other languages is to use a “ ” pre‐
304              fix inside a multiline comment.  For example,  the  initial  log
305              comment of a C program conventionally is of the following form:
306
307                     /∗
308                      ∗ $Log$
309                      ∗/
310
311              For  backwards  compatibility with older versions of RCS, if the
312              log prefix is /∗ or  (∗  surrounded  by  optional  white  space,
313              inserted  log  lines contain a space instead of / or (; however,
314              this usage is obsolescent and should not be relied on.
315
316       $Name$ The symbolic name used to check out the revision, if  any.   For
317              example,  co -rJoe  generates  $Name: Joe $.  Plain co generates
318              just $Name:  $.
319
320       $RCSfile$
321              The RCS file name without directory components.
322
323       $Revision$
324              The revision number assigned to the revision.
325
326       $Source$
327              The full RCS file name.
328
329       $State$
330              The state assigned to the revision with the -s option of  rcs(1)
331              or ci(1).
332
333       The  following  characters  in keyword values are represented by escape
334       sequences to keep keyword strings well-formed.
335
336              char     escape sequence
337              tab      \t
338              newline  \n
339              space    \040
340              $        \044
341              \        \\
342

FILE MODES

344       The working file inherits the read and execute permissions from the RCS
345       file.  In addition, the owner write permission is turned on, unless -kv
346       is set or the file is checked out unlocked and locking is set to strict
347       (see rcs(1)).
348
349       If  a  file  with  the  name of the working file exists already and has
350       write permission, co aborts the checkout, asking beforehand  if  possi‐
351       ble.   If the existing working file is not writable or -f is given, the
352       working file is deleted without asking.
353

FILES

355       co accesses files much as ci(1) does, except that it does not  need  to
356       read the working file unless a revision number of $ is specified.
357

ENVIRONMENT

359       RCSINIT
360              Options  prepended to the argument list, separated by spaces.  A
361              backslash escapes spaces within an option.  The RCSINIT  options
362              are  prepended to the argument lists of most RCS commands.  Use‐
363              ful RCSINIT options include -q, -V, -x, and -z.
364
365       RCS_MEM_LIMIT
366              Normally, for speed, commands either memory  map  or  copy  into
367              memory  the  RCS file if its size is less than the memory-limit,
368              currently defaulting to ``unlimited''.   Otherwise  (or  if  the
369              initially-tried  speedy  ways  fail),  the commands fall back to
370              using standard i/o routines.  You can adjust the memory limit by
371              setting  RCS_MEM_LIMIT to a numeric value lim (measured in kilo‐
372              bytes).  An empty value is silently ignored.  As a side  effect,
373              specifying RCS_MEM_LIMIT inhibits fall-back to slower routines.
374
375       TMPDIR Name  of  the  temporary directory.  If not set, the environment
376              variables TMP and TEMP are inspected instead and the first value
377              found  is  taken;  if  none  of  them  are set, a host-dependent
378              default is used, typically /tmp.
379

DIAGNOSTICS

381       The RCS file name, the working  file  name,  and  the  revision  number
382       retrieved  are  written  to  the diagnostic output.  The exit status is
383       zero if and only if all operations were successful.
384

IDENTIFICATION

386       Author: Walter F. Tichy.
387       Manual Page Revision: 5.10.0; Release Date: 2020-12-08.
388       Copyright © 2010-2020 Thien-Thi Nguyen.
389       Copyright © 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert.
390       Copyright © 1982, 1988, 1989 Walter F. Tichy.
391

SEE ALSO

393       ci(1), ctime(3), date(1), ident(1), make(1), rcs(1), rcsclean(1), rcsd‐
394       iff(1), rcsmerge(1), rlog(1), rcsfile(5).
395
396       Walter  F. Tichy, RCS--A System for Version Control, Software--Practice
397       & Experience 15, 7 (July 1985), 637-654.
398
399       The full documentation for RCS is maintained as a Texinfo  manual.   If
400       the  info(1)  and RCS programs are properly installed at your site, the
401       command
402
403              info rcs
404
405       should give you access to the complete manual.  Additionally,  the  RCS
406       homepage:
407
408              http://www.gnu.org/software/rcs/
409
410       has news and links to the latest release, development site, etc.
411

LIMITS

413       Links to the RCS and working files are not preserved.
414
415       There  is  no  way  to  selectively suppress the expansion of keywords,
416       except by writing them differently.  In nroff and troff, this  is  done
417       by embedding the null-character \& into the keyword.
418
419
420
421GNU RCS 5.10.0                    2020-12-08                             CO(1)
Impressum