BSD 4_4 development
[unix-history] / usr / contrib / man / cat1 / co.0
CO(1) BSD Reference Manual CO(1)
N\bNA\bAM\bME\bE
co - check out RCS revisions
S\bSY\bYN\bNO\bOP\bPS\bSI\bIS\bS
c\bco\bo [_\bo_\bp_\bt_\bi_\bo_\bn_\bs] _\bf_\bi_\bl_\be ...
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
c\bco\bo 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 c\bci\bi(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 r\brc\bcs\bs(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, c\bco\bo retrieves
the latest revision that satisfies all of them. If none
of the selection options is specified, c\bco\bo retrieves the
latest revision on the default branch (normally the trunk,
see the -\b-b\bb option of r\brc\bcs\bs(1)). A revision or branch number
may be attached to any of the options -\b-f\bf, -\b-I\bI, -\b-l\bl, -\b-M\bM, -\b-p\bp,
-\b-q\bq, -\b-r\br, or -\b-u\bu. The options -\b-d\bd (date), -\b-s\bs (state), and -\b-w\bw
(author) retrieve from a single branch, the _\bs_\be_\bl_\be_\bc_\bt_\be_\bd
branch, which is either specified by one of -\b-f\bf,\b, ..., -\b-u\bu,
or the default branch.
A c\bco\bo command applied to an RCS file with no revisions cre-
ates a zero-length working file. c\bco\bo always performs key-
word substitution (see below).
O\bOP\bPT\bTI\bIO\bON\bNS\bS
-\b-r\br[_\br_\be_\bv]
retrieves the latest revision whose number is less
than or equal to _\br_\be_\bv_\b. If _\br_\be_\bv indicates a branch
rather than a revision, the latest revision on that
branch is retrieved. If _\br_\be_\bv is omitted, the latest
GNU 1991/08/19 1
CO(1) BSD Reference Manual CO(1)
revision on the default branch (see the -\b-b\bb option
of r\brc\bcs\bs(1)) is retrieved. If _\br_\be_\bv is $\b$, c\bco\bo deter-
mines the revision number from keyword values in
the working file. Otherwise, a revision is com-
posed of one or more numeric or symbolic fields
separated by periods. The numeric equivalent of a
symbolic field is specified with the -\b-n\bn option of
the commands c\bci\bi(1) and r\brc\bcs\bs(1).
-\b-l\bl[_\br_\be_\bv]
same as -\b-r\br, except that it also locks the retrieved
revision for the caller.
-\b-u\bu[_\br_\be_\bv]
same as -\b-r\br, except that it unlocks the retrieved
revision if it was locked by the caller. If _\br_\be_\bv is
omitted, -\b-u\bu retrieves the revision locked by the
caller, if there is one; otherwise, it retrieves
the latest revision on the default branch.
-\b-f\bf[_\br_\be_\bv]
forces the overwriting of the working file; useful
in connection with -\b-q\bq. See also FILE MODES below.
-\b-k\bkk\bkv\bv Generate keyword strings using the default form,
e.g. $\b$R\bRe\bev\bvi\bis\bsi\bio\bon\bn:\b: 5\b5.\b.7\b7 $\b$ for the R\bRe\bev\bvi\bis\bsi\bio\bon\bn keyword. A
locker's name is inserted in the value of the
H\bHe\bea\bad\bde\ber\br, I\bId\bd, and L\bLo\boc\bck\bke\ber\br keyword strings only as a
file is being locked, i.e. by c\bci\bi -\b-l\bl and c\bco\bo -\b-l\bl.
This is the default.
-\b-k\bkk\bkv\bvl\bl Like -\b-k\bkk\bkv\bv, except that a locker's name is always
inserted if the given revision is currently locked.
-\b-k\bkk\bk Generate only keyword names in keyword strings;
omit their values. See KEYWORD SUBSTITUTION below.
For example, for the R\bRe\bev\bvi\bis\bsi\bio\bon\bn keyword, generate the
string $\b$R\bRe\bev\bvi\bis\bsi\bio\bon\bn$\b$ instead of $\b$R\bRe\bev\bvi\bis\bsi\bio\bon\bn:\b: 5\b5.\b.7\b7 $\b$.
This option is useful to ignore differences due to
keyword substitution when comparing different revi-
sions of a file.
-\b-k\bko\bo Generate the old keyword string, present in the
working file just before it was checked in. For
example, for the R\bRe\bev\bvi\bis\bsi\bio\bon\bn keyword, generate the
string $\b$R\bRe\bev\bvi\bis\bsi\bio\bon\bn:\b: 1\b1.\b.1\b1 $\b$ instead of $\b$R\bRe\bev\bvi\bis\bsi\bio\bon\bn:\b: 5\b5.\b.7\b7 $\b$
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 sub-
strings that happen to take the form of keyword
strings.
GNU 1991/08/19 2
CO(1) BSD Reference Manual CO(1)
-\b-k\bkv\bv Generate only keyword values for keyword strings.
For example, for the R\bRe\bev\bvi\bis\bsi\bio\bon\bn keyword, generate the
string 5\b5.\b.7\b7 instead of $\b$R\bRe\bev\bvi\bis\bsi\bio\bon\bn:\b: 5\b5.\b.7\b7 $\b$. This can
help generate files in programming languages where
it is hard to strip keyword delimiters like
$\b$R\bRe\bev\bvi\bis\bsi\bio\bon\bn:\b: $\b$ from a string. However, further key-
word substitution cannot be performed once the key-
word names are removed, so this option should be
used with care. Because of this danger of losing
keywords, this option cannot be combined with -\b-l\bl,
and the owner write permission of the working file
is turned off; to edit the file later, check it out
again without -\b-k\bkv\bv.
-\b-p\bp[_\br_\be_\bv]
prints the retrieved revision on the standard out-
put rather than storing it in the working file.
This option is useful when c\bco\bo is part of a pipe.
-\b-q\bq[_\br_\be_\bv]
quiet mode; diagnostics are not printed.
-\b-I\bI[_\br_\be_\bv]
interactive mode; the user is prompted and ques-
tioned even if the standard input is not a termi-
nal.
-\b-d\bd_\bd_\ba_\bt_\be retrieves the latest revision on the selected
branch whose checkin date/time is less than or
equal to _\bd_\ba_\bt_\be_\b. The date and time may be given in
free format. The time zone L\bLT\bT stands for local
time; other common time zone names are understood.
For example, the following _\bd_\ba_\bt_\bes are equivalent if
local time is January 11, 1990, 8pm Pacific Stan-
dard Time, eight hours west of Coordinated Univer-
sal Time (UTC):
8\b8:\b:0\b00\b0 p\bpm\bm l\blt\bt
4\b4:\b:0\b00\b0 A\bAM\bM,\b, J\bJa\ban\bn.\b. 1\b12\b2,\b, 1\b19\b99\b90\b0 note: default is UTC
1\b19\b99\b90\b0/\b/0\b01\b1/\b/1\b12\b2 0\b04\b4:\b:0\b00\b0:\b:0\b00\b0 RCS date format
T\bTh\bhu\bu J\bJa\ban\bn 1\b11\b1 2\b20\b0:\b:0\b00\b0:\b:0\b00\b0 1\b19\b99\b90\b0 L\bLT\bT output of c\bct\bti\bim\bme\be(3) + L\bLT\bT
T\bTh\bhu\bu J\bJa\ban\bn 1\b11\b1 2\b20\b0:\b:0\b00\b0:\b:0\b00\b0 P\bPS\bST\bT 1\b19\b99\b90\b0 output of d\bda\bat\bte\be(1)
F\bFr\bri\bi J\bJa\ban\bn 1\b12\b2 0\b04\b4:\b:0\b00\b0:\b:0\b00\b0 G\bGM\bMT\bT 1\b19\b99\b90\b0
T\bTh\bhu\bu,\b, 1\b11\b1 J\bJa\ban\bn 1\b19\b99\b90\b0 2\b20\b0:\b:0\b00\b0:\b:0\b00\b0 -\b-0\b08\b80\b00\b0
F\bFr\bri\bi-\b-J\bJS\bST\bT,\b, 1\b19\b99\b90\b0,\b, 1\b1p\bpm\bm J\bJa\ban\bn 1\b12\b2
1\b12\b2-\b-J\bJa\ban\bnu\bua\bar\bry\by-\b-1\b19\b99\b90\b0,\b, 0\b04\b4:\b:0\b00\b0-\b-W\bWE\bET\bT
Most fields in the date and time may be defaulted.
The default time zone is UTC. The other defaults
are determined in the order year, month, day, hour,
minute, and second (most to least significant). At
GNU 1991/08/19 3
CO(1) BSD Reference Manual CO(1)
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. For exam-
ple, the date 2\b20\b0,\b, 1\b10\b0:\b:3\b30\b0 defaults to 10:30:00 UTC of
the 20th of the UTC time zone's current month and
year. The date/time must be quoted if it contains
spaces.
-\b-M\bM[_\br_\be_\bv]
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 m\bma\bak\bke\be(1).
-\b-s\bs_\bs_\bt_\ba_\bt_\be
retrieves the latest revision on the selected
branch whose state is set to _\bs_\bt_\ba_\bt_\be_\b.
-\b-w\bw[_\bl_\bo_\bg_\bi_\bn]
retrieves the latest revision on the selected
branch which was checked in by the user with login
name _\bl_\bo_\bg_\bi_\bn_\b. If the argument _\bl_\bo_\bg_\bi_\bn is omitted, the
caller's login is assumed.
-\b-j\bj_\bj_\bo_\bi_\bn_\bl_\bi_\bs_\bt
generates a new revision which is the join of the
revisions on _\bj_\bo_\bi_\bn_\bl_\bi_\bs_\bt_\b. This option is largely
obsoleted by r\brc\bcs\bsm\bme\ber\brg\bge\be(1) but is retained for back-
wards compatibility.
The _\bj_\bo_\bi_\bn_\bl_\bi_\bs_\bt is a comma-separated list of pairs of
the form _\br_\be_\bv_\b2:\b:_\br_\be_\bv_\b3_\b, where _\br_\be_\bv_\b2 and _\br_\be_\bv_\b3 are (sym-
bolic or numeric) revision numbers. For the ini-
tial such pair, _\br_\be_\bv_\b1 denotes the revision selected
by the above options -\b-f\bf,\b, ..., -\b-w\bw. For all other
pairs, _\br_\be_\bv_\b1 denotes the revision generated by the
previous pair. (Thus, the output of one join
becomes the input to the next.)
For each pair, c\bco\bo joins revisions _\br_\be_\bv_\b1 and _\br_\be_\bv_\b3
with respect to _\br_\be_\bv_\b2_\b. This means that all changes
that transform _\br_\be_\bv_\b2 into _\br_\be_\bv_\b1 are applied to a copy
of _\br_\be_\bv_\b3_\b. This is particularly useful if _\br_\be_\bv_\b1 and
_\br_\be_\bv_\b3 are the ends of two branches that have _\br_\be_\bv_\b2 as
a common ancestor. If _\br_\be_\bv_\b1<_\br_\be_\bv_\b2<_\br_\be_\bv_\b3 on the same
branch, joining generates a new revision which is
like _\br_\be_\bv_\b3_\b, but with all changes that lead from _\br_\be_\bv_\b1
to _\br_\be_\bv_\b2 undone. If changes from _\br_\be_\bv_\b2 to _\br_\be_\bv_\b1 over-
lap with changes from _\br_\be_\bv_\b2 to _\br_\be_\bv_\b3_\b, c\bco\bo reports
overlaps as described in m\bme\ber\brg\bge\be(1).
GNU 1991/08/19 4
CO(1) BSD Reference Manual CO(1)
For the initial pair, _\br_\be_\bv_\b2 may be omitted. The
default is the common ancestor. If any of the
arguments indicate branches, the latest revisions
on those branches are assumed. The options -\b-l\bl and
-\b-u\bu lock or unlock _\br_\be_\bv_\b1_\b.
-\b-V\bV_\bn Emulate RCS version _\bn_\b, where _\bn may be 3\b3, 4\b4, or 5\b5.
This may be useful when interchanging RCS files
with others who are running older versions of RCS.
To see which version of RCS your correspondents are
running, have them invoke r\brl\blo\bog\bg on an RCS file; if
none of the first few lines of output contain the
string b\bbr\bra\ban\bnc\bch\bh:\b: it is version 3; if the dates' years
have just two digits, it is version 4; otherwise,
it is version 5. An RCS file generated while emu-
lating version 3 will lose its default branch. An
RCS 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 dates of the form
_\by_\by/\b/_\bm_\bm/\b/_\bd_\bd instead of _\by_\by_\by_\by/\b/_\bm_\bm/\b/_\bd_\bd and may also contain
different white space in the substitution for
$\b$L\bLo\bog\bg$\b$.
-\b-x\bx_\bs_\bu_\bf_\bf_\bi_\bx_\be_\bs
Use _\bs_\bu_\bf_\bf_\bi_\bx_\be_\bs to characterize RCS files. See c\bci\bi(1)
for details.
K\bKE\bEY\bYW\bWO\bOR\bRD\bD S\bSU\bUB\bBS\bST\bTI\bIT\bTU\bUT\bTI\bIO\bON\bN
Strings of the form $\b$_\bk_\be_\by_\bw_\bo_\br_\bd$\b$ and $\b$_\bk_\be_\by_\bw_\bo_\br_\bd:\b:_\b._\b._\b.$\b$ embedded
in the text are replaced with strings of the form $\b$_\bk_\be_\by_\b-
_\bw_\bo_\br_\bd:\b:_\bv_\ba_\bl_\bu_\be$\b$ where _\bk_\be_\by_\bw_\bo_\br_\bd and _\bv_\ba_\bl_\bu_\be 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 $\b$_\bk_\be_\by_\bw_\bo_\br_\bd$\b$_\b.
On checkout, c\bco\bo replaces these strings with strings of the
form $\b$_\bk_\be_\by_\bw_\bo_\br_\bd:\b:_\bv_\ba_\bl_\bu_\be$\b$_\b. 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 auto-
matic substitution can be modified by the -\b-k\bk options.
Keywords and their corresponding values:
$\b$A\bAu\but\bth\bho\bor\br$\b$
The login name of the user who checked in the revi-
sion.
$\b$D\bDa\bat\bte\be$\b$ The date and time (UTC) the revision was checked
in.
GNU 1991/08/19 5
CO(1) BSD Reference Manual CO(1)
$\b$H\bHe\bea\bad\bde\ber\br$\b$
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).
$\b$I\bId\bd$\b$ Same as $\b$H\bHe\bea\bad\bde\ber\br$\b$, except that the RCS filename is
without a path.
$\b$L\bLo\boc\bck\bke\ber\br$\b$
The login name of the user who locked the revision
(empty if not locked).
$\b$L\bLo\bog\bg$\b$ The log message supplied during checkin, preceded
by a header containing the RCS filename, the revi-
sion number, the author, and the date (UTC).
Existing log messages are _\bn_\bo_\bt replaced. Instead,
the new log message is inserted after $\b$L\bLo\bog\bg:\b:...$\b$.
This is useful for accumulating a complete change
log in a source file.
$\b$R\bRC\bCS\bSf\bfi\bil\ble\be$\b$
The name of the RCS file without a path.
$\b$R\bRe\bev\bvi\bis\bsi\bio\bon\bn$\b$
The revision number assigned to the revision.
$\b$S\bSo\bou\bur\brc\bce\be$\b$
The full pathname of the RCS file.
$\b$S\bSt\bta\bat\bte\be$\b$
The state assigned to the revision with the -\b-s\bs
option of r\brc\bcs\bs(1) or c\bci\bi(1).
F\bFI\bIL\bLE\bE M\bMO\bOD\bDE\bES\bS
The working file inherits the read and execute permissions
from the RCS file. In addition, the owner write permis-
sion is turned on, unless -\b-k\bkv\bv is set or the file is
checked out unlocked and locking is set to strict (see
r\brc\bcs\bs(1)).
If a file with the name of the working file exists already
and has write permission, c\bco\bo aborts the checkout, asking
beforehand if possible. If the existing working file is
not writable or -\b-f\bf is given, the working file is deleted
without asking.
F\bFI\bIL\bLE\bES\bS
c\bco\bo accesses files much as c\bci\bi(1) does, except that it does
not need to read the working file.
GNU 1991/08/19 6
CO(1) BSD Reference Manual CO(1)
E\bEN\bNV\bVI\bIR\bRO\bON\bNM\bME\bEN\bNT\bT
R\bRC\bCS\bSI\bIN\bNI\bIT\bT
options prepended to the argument list, separated
by spaces. See c\bci\bi(1) for details.
D\bDI\bIA\bAG\bGN\bNO\bOS\bST\bTI\bIC\bCS\bS
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.
I\bID\bDE\bEN\bNT\bTI\bIF\bFI\bIC\bCA\bAT\bTI\bIO\bON\bN
Author: Walter F. Tichy.
Revision Number: 5.7; Release Date: 1991/08/19.
Copyright (C) 1982, 1988, 1989 by Walter F. Tichy.
Copyright (C) 1990, 1991 by Paul Eggert.
S\bSE\bEE\bE A\bAL\bLS\bSO\bO
ci(1), ctime(3), date(1), ident(1), make(1), rcs(1), rcsd-
iff(1), rcsintro(1), rcsmerge(1), rlog(1), rcsfile(5)
Walter F. Tichy, RCS--A System for Version Control,
_\bS_\bo_\bf_\bt_\bw_\ba_\br_\be_\b-_\b-_\bP_\br_\ba_\bc_\bt_\bi_\bc_\be _\b& _\bE_\bx_\bp_\be_\br_\bi_\be_\bn_\bc_\be 1\b15\b5, 7 (July 1985),
637-654.
L\bLI\bIM\bMI\bIT\bTS\bS
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 \\b\&\b&
into the keyword.
B\bBU\bUG\bGS\bS
The -\b-d\bd option sometimes gets confused, and accepts no date
before 1970.
GNU 1991/08/19 7