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  revisions from RCS files.  Each file name ending in `,v'
13       is taken to be an RCS file.  All other files are assumed to be  working
14       files.   Co  retrieves a revision from each RCS file and stores it into
15       the corresponding working file.
16
17       Pairs of RCS files and working files may be specified in  3  ways  (see
18       also the example section).
19
20       1)  Both the RCS file and the working file are given. The RCS file name
21       is of the form path1/workfile,v and the working file  name  is  of  the
22       form path2/workfile, where path1/ and path2/ are (possibly different or
23       empty) paths and workfile is a file name.
24
25       2) Only the RCS file is given. Then the working file is created in  the
26       current directory and its name is derived from the name of the RCS file
27       by removing path1/ and the suffix `,v'.
28
29       3) Only the working file is given.  Then the name of the  RCS  file  is
30       derived  from  the  name  of  the  working  file by removing path2/ and
31       appending the suffix `,v'.
32
33       If the RCS file is omitted or specified without a path, then  co  looks
34       for  the  RCS file first in the directory ./RCS and then in the current
35       directory.
36
37       Revisions of an RCS file may be checked out locked or unlocked. Locking
38       a  revision  prevents  overlapping  updates. A revision checked out for
39       reading or processing (e.g., compiling) need not be locked. A  revision
40       checked  out  for  editing  and  later checkin must normally be locked.
41       Locking a revision currently locked by another user fails. (A lock  may
42       be  broken  with  the  rcs  (1) command.)  Co with locking requires the
43       caller to be on the access list of the RCS file, unless he is the owner
44       of  the file or the superuser, or the access list is empty.  Co without
45       locking is not subject to accesslist restrictions.
46
47       A revision is selected by number, checkin date/time, author, or  state.
48       If  none  of  these  options  are specified, the latest revision on the
49       trunk is retrieved.  When the options are applied in  combination,  the
50       latest  revision  that satisfies all of them is retrieved.  The options
51       for date/time, author, and state retrieve a revision  on  the  selected
52       branch.  The selected branch is either derived from the revision number
53       (if given), or is the highest branch on the trunk.  A  revision  number
54       may be attached to one of the options -l, -p, -q, or -r.
55
56       A  co  command applied to an RCS file with no revisions creates a zero-
57       length file.  Co always performs keyword substitution (see below).
58
59       -l[rev]    locks the checked out revision for the caller.  If  omitted,
60                  the  checked  out revision is not locked.  See option -r for
61                  handling of the revision number rev.
62
63       -p[rev]    prints the retrieved revision on the std. output rather than
64                  storing  it in the working file.  This option is useful when
65                  co is part of a pipe.
66
67       -q[rev]    quiet mode; diagnostics are not printed.
68
69       -ddate     retrieves the latest revision on the selected  branch  whose
70                  checkin  date/time  is less than or equal to date.  The date
71                  and time may be given in free format and  are  converted  to
72                  local time.  Examples of formats for date:
73
74                  22-April-1982, 17:20-CDT,
75                  2:25 AM, Dec. 29, 1983,
76                  Tue-PDT, 1981, 4pm Jul 21         (free format),
77                  Fri, April 16 15:52:25 EST 1982 (output of ctime).
78
79                  Most  fields  in  the  date  and  time may be defaulted.  Co
80                  determines the defaults in the order year, month, day, hour,
81                  minute, and second (most to least significant). At least one
82                  of these fields must be provided. For  omitted  fields  that
83                  are  of higher significance than the highest provided field,
84                  the current  values  are  assumed.  For  all  other  omitted
85                  fields,  the  lowest possible values are assumed.  For exam‐
86                  ple, the date "20, 10:30" defaults to 10:30:00 of  the  20th
87                  of  the  current month and current year.  The date/time must
88                  be quoted if it contains spaces.
89
90       -r[rev]    retrieves the latest revision whose number is less  than  or
91                  equal to rev.  If rev indicates a branch rather than a revi‐
92                  sion, the latest revision on that branch is retrieved.   Rev
93                  is  composed of one or more numeric or symbolic fields sepa‐
94                  rated by `.'. The numeric equivalent of a symbolic field  is
95                  specified with the -n option of the commands ci and rcs.
96
97       -sstate    retrieves  the  latest revision on the selected branch whose
98                  state is set to state.
99
100       -w[login]  retrieves the latest revision on the selected  branch  which
101                  was  checked  in  by  the user with login name login. If the
102                  argument login is omitted, the caller's login is assumed.
103
104       -jjoinlist generates a new revision which is the join of the  revisions
105                  on joinlist.  Joinlist is a comma-separated list of pairs of
106                  the form rev2:rev3, where rev2 and  rev3  are  (symbolic  or
107                  numeric)  revision numbers.  For the initial such pair, rev1
108                  denotes the revision selected by the options  -l,  ...,  -w.
109                  For  all other pairs, rev1 denotes the revision generated by
110                  the previous pair. (Thus, the output of one join becomes the
111                  input to the next.)
112
113                  For each pair, co joins revisions rev1 and rev3 with respect
114                  to rev2.  This means that all changes  that  transform  rev2
115                  into  rev1  are applied to a copy of rev3.  This is particu‐
116                  larly useful if rev1 and rev3 are the ends of  two  branches
117                  that  have  rev2 as a common ancestor. If rev1 < rev2 < rev3
118                  on the same branch, joining generates a new  revision  which
119                  is  like  rev3,  but with all changes that lead from rev1 to
120                  rev2 undone.  If changes from  rev2  to  rev1  overlap  with
121                  changes  from rev2 to rev3, co prints a warning and includes
122                  the   overlapping   sections,   delimited   by   the   lines
123                  <<<<<<< rev1, =======, and >>>>>>> rev3.
124
125                  For  the  initial  pair, rev2 may be omitted. The default is
126                  the common ancestor.   If  any  of  the  arguments  indicate
127                  branches,   the  latest  revisions  on  those  branches  are
128                  assumed. If the option -l is present, the  initial  rev1  is
129                  locked.
130

KEYWORD SUBSTITUTION

132       Strings  of  the  form $keyword$ and $keyword:...$ embedded in the text
133       are replaced with strings of the form $keyword: value $, where  keyword
134       and  value are pairs listed below.  Keywords may be embedded in literal
135       strings or comments to identify a revision.
136
137       Initially, the user enters strings of the form $keyword$.  On checkout,
138       co  replaces  these strings with strings of the form $keyword: value $.
139       If a revision containing strings of the latter form is checked back in,
140       the  value fields will be replaced during the next checkout.  Thus, the
141       keyword values are automatically updated on checkout.
142
143       Keywords and their corresponding values:
144
145       $Author$     The login name of the user who checked in the revision.
146
147       $Date$       The date and time the revision was checked in.
148
149       $Header$     A standard header containing the RCS file name, the  revi‐
150                    sion number, the date, the author, and the state.
151
152       $Locker$     The  login name of the user who locked the revision (empty
153                    if not locked).
154
155       $Log$        The log message supplied during  checkin,  preceded  by  a
156                    header  containing the RCS file name, the revision number,
157                    the author, and the date.  Existing log messages  are  NOT
158                    replaced.   Instead, the new log message is inserted after
159                    $Log:...$.  This is useful  for  accumulating  a  complete
160                    change log in a source file.
161
162       $Revision$   The revision number assigned to the revision.
163
164       $Source$     The full pathname of the RCS file.
165
166       $State$      The state assigned to the revision with rcs -s or ci -s.
167

DIAGNOSTICS

169       The  RCS  file  name,  the  working  file name, and the revision number
170       retrieved are written to the diagnostic output.  The exit status always
171       refers to the last file checked out, and is 0 if the operation was suc‐
172       cessful, 1 otherwise.
173

EXAMPLES

175       Suppose the current directory contains a subdirectory `RCS' with an RCS
176       file  `io.c,v'.  Then all of the following commands retrieve the latest
177       revision from `RCS/io.c,v' and store it into `io.c'.
178
179               co  io.c;    co RCS/io.c,v;    co  io.c,v;
180               co  io.c  RCS/io.c,v;    co  io.c  io.c,v;
181               co  RCS/io.c,v  io.c;    co  io.c,v  io.c;
182

FILE MODES

184       The working file inherits the read and execute permissions from the RCS
185       file.  In addition, the owner write permission is turned on, unless the
186       file is checked out unlocked and locking is  set  to  strict  (see  rcs
187       (1)).
188
189       If  a  file  with  the  name of the working file exists already and has
190       write permission, co aborts the  checkout  if  -q  is  given,  or  asks
191       whether  to  abort  if -q is not given. If the existing working file is
192       not writable, it is deleted before the checkout.
193

FILES

195       The caller of the command must have write  permission  in  the  working
196       directory, read permission for the RCS file, and either read permission
197       (for reading) or read/write permission (for locking) in  the  directory
198       which contains the RCS file.
199
200       A  number  of temporary files are created.  A semaphore file is created
201       in the directory of the RCS file to prevent simultaneous update.
202

IDENTIFICATION

204       Author: Walter F. Tichy, Purdue University, West Lafayette, IN, 47907.
205       Revision Number: 3.1 ; Release Date: 83/04/04 .
206       Copyright © 1982 by Walter F. Tichy.
207

SEE ALSO

209       ci (1), ident(1), rcs (1), rcsdiff (1),  rcsintro  (1),  rcsmerge  (1),
210       rlog (1), rcsfile (5), sccstorcs (8).
211       Walter  F. Tichy, "Design, Implementation, and Evaluation of a Revision
212       Control System," in Proceedings of the 6th International Conference  on
213       Software Engineering, IEEE, Tokyo, Sept. 1982.
214

LIMITATIONS

216       The  option -d gets confused in some circumstances, and accepts no date
217       before 1970.  There is no way to suppress the  expansion  of  keywords,
218       except by writing them differently. In nroff and troff, this is done by
219       embedding the null-character `\&' into the keyword.
220

BUGS

222       The option -j does not work for files that contain lines with a  single
223       `.'.
224
225
226
227Purdue University                   6/29/83                              CO(1)
Impressum