1 2 3 4CO(1L) CO(1L) 5 6 7NNAAMMEE 8 co - check out RCS revisions 9 10SSYYNNOOPPSSIISS 11 ccoo [ options ] file ... 12 13DDEESSCCRRIIPPTTIIOONN 14 _C_o retrieves a revision from each RCS file and stores it 15 into the corresponding working file. Each file name 16 ending in `,v' is taken to be an RCS file; all other files 17 are assumed to be working files. If only a working file 18 is given, _c_o tries to find the corresponding RCS file in 19 the directory ./RCS and then in the current directory. 20 For more details, see the file naming section below. 21 22 Revisions of an RCS file may be checked out locked or 23 unlocked. Locking a revision prevents overlapping updates. 24 A revision checked out for reading or processing (e.g., 25 compiling) need not be locked. A revision checked out for 26 editing and later checkin must normally be locked. _C_o with 27 locking fails if the revision to be checked out is 28 currently locked by another user. (A lock may be broken 29 with the _r_c_s(1L) command.) _C_o with locking also requires 30 the caller to be on the access list of the RCS file, 31 unless he is the owner of the file or the superuser, or 32 the access list is empty. _C_o without locking is not 33 subject to accesslist restrictions, and is not affected by 34 the presence of locks. 35 36 A revision is selected by options for revision or branch 37 number, checkin date/time, author, or state. When the 38 selection options are applied in combination, _c_o retrieves 39 the latest revision that satisfies all of them. If none 40 of the selection options is specified, _c_o retrieves the 41 latest revision on the default branch (normally the trunk, 42 see the --bb option of _r_c_s(1L)). A revision or branch 43 number may be attached to any of the options --ff, --ll, --pp, 44 --qq, --rr, or --uu. The options --dd (date), --ss (state), and --ww 45 (author) retrieve from a single branch, the _s_e_l_e_c_t_e_d 46 branch, which is either specified by one of --ff,..., --uu, or 47 the default branch. 48 49 A _c_o command applied to an RCS file with no revisions 50 creates a zero-length working file. _C_o always performs 51 keyword substitution (see below). 52 53 54 --rr[_r_e_v] retrieves the latest revision whose number is 55 less than or equal to _r_e_v. If _r_e_v indicates a 56 branch rather than a revision, the latest 57 revision on that branch is retrieved. If _r_e_v 58 is omitted, the latest revision on the default 59 branch (see the --bb option of _r_c_s(1L)) is 60 retrieved. _R_e_v is composed of one or more 61 62 63 64University Purdue 1 65 66 67 68 69 70CO(1L) CO(1L) 71 72 73 numeric or symbolic fields separated by `.'. 74 The numeric equivalent of a symbolic field is 75 specified with the --nn option of the commands 76 _c_i(1L) and _r_c_s(1L). 77 78 --ll[_r_e_v] same as --rr, except that it also locks the 79 retrieved revision for the caller. See option 80 --rr for handling of the revision number _r_e_v . 81 82 --uu[_r_e_v] same as --rr, except that it unlocks the 83 retrieved revision (if it was locked by the 84 caller). If _r_e_v is omitted, --uu retrieves the 85 latest revision locked by the caller; if no 86 such lock exists, it retrieves the latest 87 revision on the default branch. 88 89 --ff[_r_e_v] forces the overwriting of the working file; 90 useful in connection with --qq. See also the 91 section on file modes below. 92 93 --pp[_r_e_v] prints the retrieved revision on the standard 94 output rather than storing it in the working 95 file. This option is useful when _c_o is part of 96 a pipe. 97 98 --qq[_r_e_v] quiet mode; diagnostics are not printed. 99 100 --dd_d_a_t_e retrieves the latest revision on the selected 101 branch whose checkin date/time is less than or 102 equal to _d_a_t_e. The date and time may be given 103 in free format and are converted to local time. 104 Examples of formats for _d_a_t_e: 105 106 _2_2-_A_p_r_i_l-_1_9_8_2, _1_7:_2_0-_C_D_T, 107 _2:_2_5 _A_M, _D_e_c. _2_9, _1_9_8_3, 108 _T_u_e-_P_D_T, _1_9_8_1, _4_p_m _J_u_l _2_1 (free format), 109 _F_r_i, _A_p_r_i_l _1_6 _1_5:_5_2:_2_5 _E_S_T _1_9_8_2 (output of ctime). 110 111 Most fields in the date and time may be 112 defaulted. _C_o determines the defaults in the 113 order year, month, day, hour, minute, and 114 second (most to least significant). At least 115 one of these fields must be provided. For 116 omitted fields that are of higher significance 117 than the highest provided field, the current 118 values are assumed. For all other omitted 119 fields, the lowest possible values are assumed. 120 For example, the date "20, 10:30" defaults to 121 10:30:00 of the 20th of the current month and 122 current year. The date/time must be quoted if 123 it contains spaces. 124 125 --ss_s_t_a_t_e retrieves the latest revision on the selected 126 branch whose state is set to _s_t_a_t_e. 127 128 129 130University Purdue 2 131 132 133 134 135 136CO(1L) CO(1L) 137 138 139 --ww[_l_o_g_i_n] retrieves the latest revision on the selected 140 branch which was checked in by the user with 141 login name _l_o_g_i_n. If the argument _l_o_g_i_n is 142 omitted, the caller's login is assumed. 143 144 --jj_j_o_i_n_l_i_s_t generates a new revision which is the join of 145 the revisions on _j_o_i_n_l_i_s_t. _J_o_i_n_l_i_s_t is a 146 comma-separated list of pairs of the form 147 _r_e_v_2:_r_e_v_3, where _r_e_v_2 and _r_e_v_3 are (symbolic or 148 numeric) revision numbers. For the initial 149 such pair, _r_e_v_1 denotes the revision selected 150 by the above options --rr, ..., --ww. For all other 151 pairs, _r_e_v_1 denotes the revision generated by 152 the previous pair. (Thus, the output of one 153 join becomes the input to the next.) 154 155 For each pair, _c_o joins revisions _r_e_v_1 and _r_e_v_3 156 with respect to _r_e_v_2. This means that all 157 changes that transform _r_e_v_2 into _r_e_v_1 are 158 applied to a copy of _r_e_v_3. This is 159 particularly useful if _r_e_v_1 and _r_e_v_3 are the 160 ends of two branches that have _r_e_v_2 as a common 161 ancestor. If _r_e_v_1 < _r_e_v_2 < _r_e_v_3 on the same 162 branch, joining generates a new revision which 163 is like _r_e_v_3, but with all changes that lead 164 from _r_e_v_1 to _r_e_v_2 undone. If changes from _r_e_v_2 165 to _r_e_v_1 overlap with changes from _r_e_v_2 to _r_e_v_3, 166 _c_o prints a warning and includes the 167 overlapping sections, delimited by the lines 168 <<<<<<< _r_e_v_1, =======, and >>>>>>> _r_e_v_3. 169 170 For the initial pair, _r_e_v_2 may be omitted. The 171 default is the common ancestor. If any of the 172 arguments indicate branches, the latest 173 revisions on those branches are assumed. The 174 options --ll and --uu lock or unlock _r_e_v_1. 175 176KKEEYYWWOORRDD SSUUBBSSTTIITTUUTTIIOONN 177 Strings of the form $_k_e_y_w_o_r_d$ and $_k_e_y_w_o_r_d:...$ embedded 178 in the text are replaced with strings of the form 179 $_k_e_y_w_o_r_d: _v_a_l_u_e $, where _k_e_y_w_o_r_d and _v_a_l_u_e are pairs 180 listed below. Keywords may be embedded in literal strings 181 or comments to identify a revision. 182 183 Initially, the user enters strings of the form $_k_e_y_w_o_r_d$. 184 On checkout, _c_o replaces these strings with strings of the 185 form $_k_e_y_w_o_r_d: _v_a_l_u_e $. If a revision containing strings 186 of the latter form is checked back in, the value fields 187 will be replaced during the next checkout. Thus, the 188 keyword values are automatically updated on checkout. 189 190 Keywords and their corresponding values: 191 192 $Author$ The login name of the user who checked in the 193 194 195 196University Purdue 3 197 198 199 200 201 202CO(1L) CO(1L) 203 204 205 revision. 206 207 $Date$ The date and time the revision was checked 208 in. 209 210 $Header$ A standard header containing the full 211 pathname of the RCS file, the revision 212 number, the date, the author, the state, and 213 the locker (if locked). 214 215 $Id$ Same as $Header$, except that the RCS file 216 name is without a path. 217 218 $Locker$ The login name of the user who locked the 219 revision (empty if not locked). 220 221 $Log$ The log message supplied during checkin, 222 preceded by a header containing the RCS file 223 name, the revision number, the author, and 224 the date. Existing log messages are NOT 225 replaced. Instead, the new log message is 226 inserted after $_L_o_g:...$. This is useful for 227 accumulating a complete change log in a 228 source file. 229 230 $RCSfile$ The name of the RCS file without path. 231 232 $Revision$ The revision number assigned to the revision. 233 234 $Source$ The full pathname of the RCS file. 235 236 $State$ The state assigned to the revision with the 237 --ss option of _r_c_s(1L) or _c_i(1L). 238 239 240 FFIILLEE NNAAMMIINNGG 241 Pairs of RCS files and working files may be 242 specified in 3 ways (see also the example section). 243 244 1) Both the RCS file and the working file are given. The 245 RCS file name is of the form _p_a_t_h_1/_w_o_r_k_f_i_l_e,_v and the 246 working file name is of the form _p_a_t_h_2/_w_o_r_k_f_i_l_e, where 247 _p_a_t_h_1/ and _p_a_t_h_2/ are (possibly different or empty) paths 248 and _w_o_r_k_f_i_l_e is a file name. 249 250 2) Only the RCS file is given. Then the working file is 251 created in the current directory and its name is derived 252 from the name of the RCS file by removing _p_a_t_h_1/ and the 253 suffix ,_v. 254 255 3) Only the working file is given. Then _c_o looks for an 256 RCS file of the form _p_a_t_h_2/_R_C_S/_w_o_r_k_f_i_l_e,_v or 257 _p_a_t_h_2/_w_o_r_k_f_i_l_e,_v (in this order). 258 259 260 261 262University Purdue 4 263 264 265 266 267 268CO(1L) CO(1L) 269 270 271 If the RCS file is specified without a path in 1) and 2), 272 then _c_o looks for the RCS file first in the directory 273 ./RCS and then in the current directory. 274 275EEXXAAMMPPLLEESS 276 Suppose the current directory contains a subdirectory 277 `RCS' with an RCS file `io.c,v'. Then all of the following 278 commands retrieve the latest revision from `RCS/io.c,v' 279 and store it into `io.c'. 280 281 co io.c; co RCS/io.c,v; co io.c,v; 282 co io.c RCS/io.c,v; co io.c io.c,v; 283 co RCS/io.c,v io.c; co io.c,v io.c; 284 285FFIILLEE MMOODDEESS 286 The working file inherits the read and execute permissions 287 from the RCS file. In addition, the owner write permission 288 is turned on, unless the file is checked out unlocked and 289 locking is set to _s_t_r_i_c_t (see _r_c_s(1L)). 290 291 If a file with the name of the working file exists already 292 and has write permission, _c_o aborts the checkout if --qq is 293 given, or asks whether to abort if --qq is not given. If the 294 existing working file is not writable or --ff is given, the 295 working file is deleted without asking. 296 297FFIILLEESS 298 The caller of the command must have write permission in 299 the working directory, read permission for the RCS file, 300 and either read permission (for reading) or read/write 301 permission (for locking) in the directory which contains 302 the RCS file. 303 304 A number of temporary files are created. A semaphore file 305 is created in the directory of the RCS file to prevent 306 simultaneous update. 307 308DDIIAAGGNNOOSSTTIICCSS 309 The RCS file name, the working file name, and the revision 310 number retrieved are written to the diagnostic output. 311 The exit status always refers to the last file checked 312 out, and is 0 if the operation was successful, 1 313 otherwise. 314 315IIDDEENNTTIIFFIICCAATTIIOONN 316 Author: Walter F. Tichy, Purdue University, West 317 Lafayette, IN, 47907. 318 Revision Number: 1.4 ; Release Date: 89/05/02 . 319 Copyright (C) 1982, 1988, 1989 by Walter F. Tichy. 320 321SSEEEE AALLSSOO 322 ci(1L), ident(1L), rcs(1L), rcsdiff(1L), rcsintro(1L), 323 rcsmerge(1L), rlog(1L), rcsfile(5L) 324 Walter F. Tichy, "Design, Implementation, and Evaluation 325 326 327 328University Purdue 5 329 330 331 332 333 334CO(1L) CO(1L) 335 336 337 of a Revision Control System," in _P_r_o_c_e_e_d_i_n_g_s _o_f _t_h_e _6_t_h 338 _I_n_t_e_r_n_a_t_i_o_n_a_l _C_o_n_f_e_r_e_n_c_e _o_n _S_o_f_t_w_a_r_e _E_n_g_i_n_e_e_r_i_n_g, IEEE, 339 Tokyo, Sept. 1982. 340 341LLIIMMIITTAATTIIOONNSS 342 The option --dd gets confused in some circumstances, and 343 accepts no date before 1970. Links to the RCS and working 344 files are not preserved. There is no way to suppress the 345 expansion of keywords, except by writing them differently. 346 In nroff and troff, this is done by embedding the null- 347 character `\&' into the keyword. 348 349BBUUGGSS 350 The option --jj does not work for files that contain lines 351 with a single `.'. 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394University Purdue 6 395 396 397