co - check out RCS revisions
co [options] file...
retrieves the latest revision whose number is less than or equal to rev. If rev indicates a branch rather than a revision, the latest revision on that branch is retrieved. If rev is omitted, the latest revision on the default branch (see the -b option of rcs(1)) is retrieved. If rev is $, co determines the revision number from keyword values in the working file. Otherwise, a revision is composed of one or more numeric or symbolic fields separated by periods. The numeric equivalent of a symbolic field is specified with the -n option of the commands ci(1) and rcs(1). same as -r, except that it also locks the retrieved revision for the caller. same as -r, except that it unlocks the retrieved revision if it was locked by the caller. If rev is omitted, -u retrieves the revision locked by the caller, if there is one; otherwise, it retrieves the latest revision on the default branch. forces the overwriting of the working file; useful in connection with -q. See also FILE MODES below. Generate keyword strings using the default form, e.g. $Revision: 220.127.116.11 $ for the Revision keyword. A locker's name is inserted in the value of the Header, Id, and Locker keyword strings only as a file is being locked, i.e. by ci -l and co -l. This is the default. Like -kkv, except that a locker's name is always inserted if the given revision is currently locked. Generate only keyword names in keyword strings; omit their values. See KEYWORD SUBSTITUTION below. For example, for the Revision keyword, generate the string $Revision$ instead of $Revision: 18.104.22.168$. This option is useful to ignore differences due to keyword substitution when comparing different revisions of a file. Generate the old keyword string, present in the working file just before it was checked in. For example, for the Revision keyword, generate the string $Revision: 1.1 $ instead of $Revision: 22.214.171.124 $ if that is how the string appeared when the file was checked in. This can be useful for binary file formats that cannot tolerate any changes to substrings that happen to take the form of keyword strings. Generate only keyword values for keyword strings. For example, for the Revision keyword, generate the string 126.96.36.199 instead of $Revision: 188.8.131.52 $. This can help generate files in programming languages where it is hard to strip keyword delimiters like $Revision: $ from a string. However, further keyword substitution cannot be performed once the keyword names are removed, so this option should be used with care. Because of this danger of losing keywords, this option cannot be combined with -l, and the owner write permission of the working file is turned off; to edit the file later, check it out again without -kv. prints the retrieved revision on the standard output rather than storing it in the working file. This option is useful when co is part of a pipe. quiet mode; diagnostics are not printed. interactive mode; the user is prompted and questioned even if the standard input is not a terminal. retrieves the latest revision on the selected branch whose checkin date/time is less than or equal to date. The date and time may be given in free format. The time zone LT stands for local time; other common time zone names are understood. For example, the following dates are equivalent if local time is January 11, 1990, 8pm Pacific Standard Time, eight hours west of Coordinated Universal Time (UTC):
co retrieves a revision from each RCS file and stores it into the corresponding working file.
Pathnames matching an RCS suffix denote RCS files; all others denote working files. Names are paired as explained in ci(1).
Revisions of an RCS file may be checked out locked or unlocked. Locking a revision prevents overlapping updates. A revision checked out for reading or processing (e.g., compiling) need not be locked. A revision checked out for editing and later checkin must normally be locked. Checkout with locking fails if the revision to be checked out is currently locked by another user. (A lock may be broken with rcs(1).) Checkout with locking also requires the caller to be on the access list of the RCS file, unless he is the owner of the file or the superuser, or the access list is empty. Checkout without locking is not subject to accesslist restrictions, and is not affected by the presence of locks.
A revision is selected by options for revision or branch number, checkin date/time, author, or state. When the selection options are applied in combination, co retrieves the latest revision that satisfies all of them. If none of the selection options is specified, co retrieves the latest revision on the default branch (normally the trunk, see the -b option of rcs(1)). A revision or branch number may be attached to any of the options -f, -I, -l, -M, -p, -q, -r, or -u. The options -d (date), -s (state), and -w (author) retrieve from a single branch, the selected branch, which is either specified by one of -f, ..., -u, or the default branch.
command applied to an RCS file with no revisions
creates a zero-length working file.
keyword substitution (see below).
Strings of the form $keyword$ and $keyword:...$ embedded in the text are replaced with strings of the form $keyword:value$ where keyword and value are pairs listed below. Keywords may be embedded in literal strings or comments to identify a revision.
Initially, the user enters strings of the form $keyword$. On checkout, co replaces these strings with strings of the form $keyword:value$. If a revision containing strings of the latter form is checked back in, the value fields will be replaced during the next checkout. Thus, the keyword values are automatically updated on checkout. This automatic substitution can be modified by the -k options.
Keywords and their corresponding values:
The login name of the user who checked in the revision.
The date and time (UTC) the revision was checked in.
A standard header containing the full pathname of the RCS
file, the revision number, the date (UTC), the author, the state, and the
locker (if locked).
$Header$, except that the RCS filename is without a path.
The login name of the user who locked the revision (empty
if not locked).
The log message supplied during checkin, preceded by a header
containing the RCS filename, the revision number, the author, and the date
(UTC). Existing log messages are
the new log message is inserted after
$Log:...$. This is useful for accumulating a complete
change log in a source file.
The name of the RCS file without a path.
The revision number assigned to the revision.
The full pathname of the RCS file.
The state assigned to the revision with the
The working file inherits the read and execute permissions from the RCS file. In addition, the owner write permission is turned on, unless -kv is set or the file is checked out unlocked and locking is set to strict (see rcs(1)).
If a file with the name of the working file exists already and has write
aborts the checkout, asking beforehand if
possible. If the existing working file is not writable or
is given, the working file is deleted without asking.
Links to the RCS and working files are not preserved.
There is no way to selectively suppress the expansion of keywords, except by writing them differently. In nroff and troff, this is done by embedding the null-character \& into the keyword.
option sometimes gets confused, and accepts no
date before 1970.
accesses files much as
that it does not need to read the working file.
options prepended to the argument list, separated by spaces.
The RCS pathname, the working pathname, and the revision number retrieved
are written to the diagnostic output. The exit status is zero if and only
if all operations were successful.
Author: Walter F. Tichy. Revision Number: 184.108.40.206; Release Date: 1993/10/07. Copyright (C) 1982, 1988, 1989 by Walter F. Tichy. Copyright (C) 1990, 1991 by Paul Eggert.
ci(1), ctime(3), date(1), ident(1), make(1), rcs(1), rcsdiff(1), rcsintro(1), rcsmerge(1), rlog(1), rcsfile(5)
Walter F. Tichy, RCS--A System for Version Control, Software--Practice & Experience 15, 7 (July 1985), 637-654.