.Id $Id: co.1,v 5.7 1991/08/19 03:13:55 eggert Exp $
co \- check out RCS revisions
.RI [ options ] " file " .\|.\|.
retrieves a revision from each \*r file and stores it into
the corresponding working file.
Pathnames matching an \*r suffix denote \*r files;
all others denote working files.
Names are paired as explained in
Revisions of an \*r 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
Checkout with locking also requires the caller to be on the access list of
the \*r 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,
retrieves the latest revision
that satisfies all of them.
If none of the selection options
retrieves the latest revision
on the default branch (normally the trunk, see the
A revision or branch number may be attached
retrieve from a single branch, the
which is either specified by one of
command applied to an \*r
file with no revisions creates a zero-length working file.
always performs keyword substitution (see below).
retrieves the latest revision whose number is less than or equal to
indicates a branch rather than a revision,
the latest revision on that branch is retrieved.
is omitted, the latest revision on the default branch
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
except that it also locks the retrieved revision for
except that it unlocks the retrieved revision if it was
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
Generate keyword strings using the default form, e.g.\&
.B "$\&Revision: \*(Rv $"
A locker's name is inserted in the value of the
only as a file is being locked,
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.
.SM "KEYWORD SUBSTITUTION"
keyword, generate the string
.BR "$\&Revision: \*(Rv $".
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.
keyword, generate the string
.B "$\&Revision: \*(Rv $"
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.
keyword, generate the string
.BR "$\&Revision: \*(Rv $".
This can help generate files in programming languages where it is hard to
strip keyword delimiters like
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
and the owner write permission of the working file is turned off;
to edit the file later, check it out again without
prints the retrieved revision on the standard output rather than storing it
This option is useful when
quiet mode; diagnostics are not printed.
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
The date and time may be given in free format.
other common time zone names are understood.
For example, the following
if local time is January 11, 1990, 8pm Pacific Standard Time,
eight hours west of Coordinated Universal Time (\*g):
.ta \w'\f3Thu, 11 Jan 1990 20:00:00 \-0800\fP 'u
\f34:00 AM, Jan. 12, 1990\fP note: default is \*g
\f31990/01/12 04:00:00\fP \*r date format
\f3Thu Jan 11 20:00:00 1990 LT\fP output of \f3ctime\fP(3) + \f3LT\fP
\f3Thu Jan 11 20:00:00 PST 1990\fP output of \f3date\fP(1)
\f3Fri Jan 12 04:00:00 GMT 1990\fP
\f3Thu, 11 Jan 1990 20:00:00 \-0800\fP
\f3Fri-JST, 1990, 1pm Jan 12\fP
\f312-January-1990, 04:00-WET\fP
Most fields in the date and time may be defaulted.
The default time zone is \*g.
The other defaults are determined in the order year, month, day,
hour, minute, and second (most to least significant). At least one of these
fields must be provided. For omitted fields that are of higher significance
than the highest provided field, the time zone's current values are assumed.
For all other omitted fields,
the lowest possible values are assumed.
10:30:00 \*g of the 20th of the \*g time zone's current month and year.
The date/time must be quoted if it contains spaces.
Set the modification time on the new working file
to be the date of the retrieved revision.
Use this option with care; it can confuse
retrieves the latest revision on the selected branch whose state is set to
retrieves the latest revision on the selected branch which was checked in
by the user with login name
omitted, the caller's login is assumed.
generates a new revision which is the join of the revisions on
This option is largely obsoleted by
but is retained for backwards compatibility.
is a comma-separated list of pairs of the form
are (symbolic or numeric)
For the initial such pair,
denotes the revision selected
denotes the revision generated by the previous pair.
of one join becomes the input to the next.)
This means that all changes that transform
This is particularly useful if
are the ends of two branches that have
joining generates a new revision which is like
but with all changes that lead from
overlap with changes from
reports overlaps as described in
may be omitted. The default is the common
If any of the arguments indicate branches, the latest revisions
on those branches are assumed.
This may be useful when interchanging \*r files with others who are
running older versions of \*r.
To see which version of \*r your correspondents are running, have them invoke
if none of the first few lines of output contain the string
if the dates' years have just two digits, it is version 4;
otherwise, it is version 5.
An \*r file generated while emulating version 3 will lose its default branch.
An \*r revision generated while emulating version 4 or earlier will have
a timestamp that is off by up to 13 hours.
A revision extracted while emulating version 4 or earlier will contain
and may also contain different white space in the substitution for
to characterize \*r files.
.SH "KEYWORD SUBSTITUTION"
.BI $ keyword : .\|.\|. $
Keywords may be embedded in literal strings
or comments to identify a revision.
Initially, the user enters strings of the form
replaces these strings with strings of the form
.BI $ keyword : value $ .
If a revision containing strings of the latter form
is checked back in, the value fields will be replaced during the next
Thus, the keyword values are automatically updated on checkout.
This automatic substitution can be modified by the
Keywords and their corresponding values:
The login name of the user who checked in the revision.
The date and time (\*g) the revision was checked in.
A standard header containing the full pathname of the \*r file, the
revision number, the date (\*g), the author, the state,
and the locker (if locked).
except that the \*r 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 \*r filename, the revision number, the author, and the date
Existing log messages are
Instead, the new log message is inserted after
accumulating a complete change log in a source file.
The name of the \*r file without a path.
The revision number assigned to the revision.
The full pathname of the \*r file.
The state assigned to the revision with the
The working file inherits the read and execute permissions from the \*r
file. In addition, the owner write permission is turned on, unless
is checked out unlocked and locking is set to strict (see
If a file with the name of the working file exists already and has write
asking beforehand if possible.
If the existing working file is
is given, the working file is deleted without asking.
does, except that it does not need to read the working file.
options prepended to the argument list, separated by spaces.
The \*r 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.
Revision Number: \*(Rv; Release Date: \*(Dt.
Copyright \(co 1982, 1988, 1989 by Walter F. Tichy.
Copyright \(co 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),
\*r\*-A System for Version Control,
.I "Software\*-Practice & Experience"
Links to the \*r 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
option sometimes gets confused, and accepts no date before 1970.