5 .Id $FreeBSD: src/gnu/usr.bin/rcs/co/co.1,v 1.6 1999/08/27 23:36:39 peter Exp $
6 .Id $DragonFly: src/gnu/usr.bin/rcs/co/co.1,v 1.2 2003/06/17 04:25:47 dillon Exp $
14 co \- check out RCS revisions
17 .RI [ options ] " file " .\|.\|.
20 retrieves a revision from each \*r file and stores it into
21 the corresponding working file.
23 Pathnames matching an \*r suffix denote \*r files;
24 all others denote working files.
25 Names are paired as explained in
28 Revisions of an \*r file can be checked out locked or unlocked. Locking a
29 revision prevents overlapping updates. A revision checked out for reading or
30 processing (e.g., compiling) need not be locked. A revision checked out
31 for editing and later checkin must normally be locked. Checkout with locking
32 fails if the revision to be checked out is currently locked by another user.
33 (A lock can be broken with
35 Checkout with locking also requires the caller to be on the access list of
36 the \*r file, unless he is the owner of the
37 file or the superuser, or the access list is empty.
38 Checkout without locking is not subject to accesslist restrictions, and is
39 not affected by the presence of locks.
41 A revision is selected by options for revision or branch number,
42 checkin date/time, author, or state.
43 When the selection options
44 are applied in combination,
46 retrieves the latest revision
47 that satisfies all of them.
48 If none of the selection options
51 retrieves the latest revision
52 on the default branch (normally the trunk, see the
56 A revision or branch number can be attached
74 retrieve from a single branch, the
77 which is either specified by one of
81 or the default branch.
85 command applied to an \*r
86 file with no revisions creates a zero-length working file.
88 always performs keyword substitution (see below).
92 retrieves the latest revision whose number is less than or equal to
96 indicates a branch rather than a revision,
97 the latest revision on that branch is retrieved.
100 is omitted, the latest revision on the default branch
111 determines the revision number from keyword values in the working file.
112 Otherwise, a revision is composed of one or more numeric or symbolic fields
113 separated by periods.
116 begins with a period,
117 then the default branch (normally the trunk) is prepended to it.
120 is a branch number followed by a period,
121 then the latest revision on that branch is used.
122 The numeric equivalent of a symbolic field
123 is specified with the
125 option of the commands
133 except that it also locks the retrieved revision for
139 except that it unlocks the retrieved revision if it was
140 locked by the caller. If
144 retrieves the revision locked by the caller, if there is one; otherwise,
145 it retrieves the latest revision on the default branch.
148 forces the overwriting of the working file;
149 useful in connection with
156 Generate keyword strings using the default form, e.g.\&
157 .B "$\&Revision: \*(Rv $"
161 A locker's name is inserted in the value of the
167 only as a file is being locked,
177 except that a locker's name is always inserted
178 if the given revision is currently locked.
181 Generate only keyword names in keyword strings; omit their values.
183 .SM "KEYWORD SUBSTITUTION"
187 keyword, generate the string
190 .BR "$\&Revision: \*(Rv $" .
191 This option is useful to ignore differences due to keyword substitution
192 when comparing different revisions of a file.
193 Log messages are inserted after
198 since this tends to be more useful when merging changes.
201 Generate the old keyword string,
202 present in the working file just before it was checked in.
205 keyword, generate the string
206 .B "$\&Revision: 1.1 $"
208 .B "$\&Revision: \*(Rv $"
209 if that is how the string appeared when the file was checked in.
210 This can be useful for file formats
211 that cannot tolerate any changes to substrings
212 that happen to take the form of keyword strings.
215 Generate a binary image of the old keyword string.
218 except it performs all working file input and output in binary mode.
219 This makes little difference on Posix and Unix hosts,
220 but on DOS-like hosts one should use
222 to initialize an \*r file intended to be used for binary files.
225 normally refuses to merge files when
230 Generate only keyword values for keyword strings.
233 keyword, generate the string
236 .BR "$\&Revision: \*(Rv $" .
237 This can help generate files in programming languages where it is hard to
238 strip keyword delimiters like
241 However, further keyword substitution cannot be performed once the
242 keyword names are removed, so this option should be used with care.
243 Because of this danger of losing keywords,
244 this option cannot be combined with
246 and the owner write permission of the working file is turned off;
247 to edit the file later, check it out again without
251 prints the retrieved revision on the standard output rather than storing it
253 This option is useful when
258 quiet mode; diagnostics are not printed.
262 the user is prompted and questioned
263 even if the standard input is not a terminal.
266 retrieves the latest revision on the selected branch whose checkin date/time is
267 less than or equal to
269 The date and time can be given in free format.
272 stands for local time;
273 other common time zone names are understood.
274 For example, the following
277 if local time is January 11, 1990, 8pm Pacific Standard Time,
278 eight hours west of Coordinated Universal Time (\*u):
283 .ta \w'\f3Thu, 11 Jan 1990 20:00:00 \-0800\fP 'u
286 \f34:00 AM, Jan. 12, 1990\fP default is \*u
287 \f31990-01-12 04:00:00+00\fP \*i 8601 (\*u)
288 \f31990-01-11 20:00:00\-08\fP \*i 8601 (local time)
289 \f31990/01/12 04:00:00\fP traditional \*r format
290 \f3Thu Jan 11 20:00:00 1990 LT\fP output of \f3ctime\fP(3) + \f3LT\fP
291 \f3Thu Jan 11 20:00:00 PST 1990\fP output of \f3date\fP(1)
292 \f3Fri Jan 12 04:00:00 GMT 1990\fP
293 \f3Thu, 11 Jan 1990 20:00:00 \-0800\fP Internet RFC 822
294 \f312-January-1990, 04:00 WET\fP
299 Most fields in the date and time can be defaulted.
300 The default time zone is normally \*u, but this can be overridden by the
303 The other defaults are determined in the order year, month, day,
304 hour, minute, and second (most to least significant). At least one of these
305 fields must be provided. For omitted fields that are of higher significance
306 than the highest provided field, the time zone's current values are assumed.
307 For all other omitted fields,
308 the lowest possible values are assumed.
314 10:30:00 \*u of the 20th of the \*u time zone's current month and year.
315 The date/time must be quoted if it contains spaces.
319 Set the modification time on the new working file
320 to be the date of the retrieved revision.
321 Use this option with care; it can confuse
325 retrieves the latest revision on the selected branch whose state is set to
329 Preserve the modification time on the \*r file
330 even if the \*r file changes because a lock is added or removed.
331 This option can suppress extensive recompilation caused by a
333 dependency of some other copy of the working file on the \*r file.
334 Use this option with care; it can suppress recompilation even when it is needed,
335 i.e. when the change of lock
336 would mean a change to keyword strings in the other working file.
338 .BR \-w [\f2login\fP]
339 retrieves the latest revision on the selected branch which was checked in
340 by the user with login name
345 omitted, the caller's login is assumed.
348 generates a new revision which is the join of the revisions on
350 This option is largely obsoleted by
352 but is retained for backwards compatibility.
357 is a comma-separated list of pairs of the form
363 are (symbolic or numeric)
365 For the initial such pair,
367 denotes the revision selected
374 denotes the revision generated by the previous pair.
376 of one join becomes the input to the next.)
386 This means that all changes that transform
390 are applied to a copy of
392 This is particularly useful if
396 are the ends of two branches that have
398 as a common ancestor. If
399 .IR rev1 < rev2 < rev3
401 joining generates a new revision which is like
403 but with all changes that lead from
412 overlap with changes from
417 reports overlaps as described in
420 For the initial pair,
422 can be omitted. The default is the common
424 If any of the arguments indicate branches, the latest revisions
425 on those branches are assumed.
435 Print \*r's version number.
447 This can be useful when interchanging \*r files with others who are
448 running older versions of \*r.
449 To see which version of \*r your correspondents are running, have them invoke
451 this works with newer versions of \*r.
452 If it doesn't work, have them invoke
455 if none of the first few lines of output contain the string
458 if the dates' years have just two digits, it is version 4;
459 otherwise, it is version 5.
460 An \*r file generated while emulating version 3 loses its default branch.
461 An \*r revision generated while emulating version 4 or earlier has
462 a time stamp that is off by up to 13 hours.
463 A revision extracted while emulating version 4 or earlier contains
464 abbreviated dates of the form
466 and can also contain different white space and line prefixes
467 in the substitution for
473 to characterize \*r files.
479 specifies the date output format in keyword substitution,
480 and specifies the default time zone for
487 should be empty, a numeric \*u offset, or the special string
490 The default is an empty
492 which uses the traditional \*r format of \*u without any time zone indication
493 and with slashes separating the parts of the date;
494 otherwise, times are output in \*i 8601 format with time zone indication.
495 For example, if local time is January 11, 1990, 8pm Pacific Standard Time,
496 eight hours west of \*u,
497 then the time is output as follows:
502 .ta \w'\f3\-z+05:30\fP 'u +\w'\f31990-01-11 09:30:00+05:30\fP 'u
504 \f2option\fP \f2time output\fP
505 \f3\-z\fP \f31990/01/12 04:00:00\fP \f2(default)\fP
506 \f3\-zLT\fP \f31990-01-11 20:00:00\-08\fP
507 \f3\-z+05:30\fP \f31990-01-12 09:30:00+05:30\fP
514 option does not affect dates stored in \*r files,
515 which are always \*u.
517 .SH "KEYWORD SUBSTITUTION"
521 .BI $ keyword : .\|.\|. $
523 the text are replaced
524 with strings of the form
525 .BI $ keyword : value $
530 are pairs listed below.
531 Keywords can be embedded in literal strings
532 or comments to identify a revision.
534 Initially, the user enters strings of the form
538 replaces these strings with strings of the form
539 .BI $ keyword : value $ .
540 If a revision containing strings of the latter form
541 is checked back in, the value fields will be replaced during the next
543 Thus, the keyword values are automatically updated on checkout.
544 This automatic substitution can be modified by the
548 Keywords and their corresponding values:
551 The login name of the user who checked in the revision.
554 The date and time the revision was checked in.
557 a numeric time zone offset is appended; otherwise, the date is \*u.
560 A standard header containing the full pathname of the \*r file, the
561 revision number, the date and time, the author, the state,
562 and the locker (if locked).
565 a numeric time zone offset is appended to the date; otherwise, the date is \*u.
570 except that the \*r filename is without a path.
573 The login name of the user who locked the revision (empty if not locked).
576 The log message supplied during checkin, preceded by a header
577 containing the \*r filename, the revision number, the author, and the date
581 a numeric time zone offset is appended; otherwise, the date is \*u.
582 Existing log messages are
585 Instead, the new log message is inserted after
586 .BR $\&Log: .\|.\|. $ .
588 accumulating a complete change log in a source file.
591 Each inserted line is prefixed by the string that prefixes the
593 line. For example, if the
596 .RB \*(lq "//\ $\&Log: tan.cc\ $" \*(rq,
597 \*r prefixes each line of the log with
598 .RB \*(lq "//\ " \*(rq.
599 This is useful for languages with comments that go to the end of the line.
600 The convention for other languages is to use a
601 .RB \*(lq " \(** " \(rq
602 prefix inside a multiline comment.
603 For example, the initial log comment of a C program
604 conventionally is of the following form:
619 For backwards compatibility with older versions of \*r, if the log prefix is
623 surrounded by optional white space, inserted log lines contain a space
628 however, this usage is obsolescent and should not be relied on.
632 The symbolic name used to check out the revision, if any.
636 .BR "$\&Name:\ Joe\ $" .
640 .BR "$\&Name:\ \ $" .
643 The name of the \*r file without a path.
646 The revision number assigned to the revision.
649 The full pathname of the \*r file.
652 The state assigned to the revision with the
659 The following characters in keyword values are represented by escape sequences
660 to keep keyword strings well-formed.
666 \f2char escape sequence\fP
675 The working file inherits the read and execute permissions from the \*r
676 file. In addition, the owner write permission is turned on, unless
679 is checked out unlocked and locking is set to strict (see
682 If a file with the name of the working file exists already and has write
686 asking beforehand if possible.
687 If the existing working file is
690 is given, the working file is deleted without asking.
693 accesses files much as
695 does, except that it does not need to read the working file
696 unless a revision number of
702 options prepended to the argument list, separated by spaces.
707 The \*r pathname, the working pathname,
708 and the revision number retrieved are
709 written to the diagnostic output.
710 The exit status is zero if and only if all operations were successful.
712 Author: Walter F. Tichy.
714 Manual Page Revision: \*(Rv; Release Date: \*(Dt.
716 Copyright \(co 1982, 1988, 1989 Walter F. Tichy.
718 Copyright \(co 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert.
720 rcsintro(1), ci(1), ctime(3), date(1), ident(1), make(1),
721 rcs(1), rcsclean(1), rcsdiff(1), rcsmerge(1), rlog(1),
725 \*r\*-A System for Version Control,
726 .I "Software\*-Practice & Experience"
728 7 (July 1985), 637-654.
730 Links to the \*r and working files are not preserved.
732 There is no way to selectively suppress the expansion of keywords, except
733 by writing them differently. In nroff and troff, this is done by embedding the