

CO(1)                      Unix Programmer's Manual                      CO(1)


NNNAAAMMMEEE
     co - check out RCS revisions

SSSYYYNNNOOOPPPSSSIIISSS
     cccooo [_o_p_t_i_o_n_s] _f_i_l_e ...

DDDEEESSSCCCRRRIIIPPPTTTIIIOOONNN
     cccooo retrieves a revision from  each  RCS  file  and  stores  it  into  the
     corresponding  working  file.  Each file name ending in ,,,vvv is taken to be
     an RCS file; all other files are assumed to be working files.  If only  a
     working file is given, cccooo tries to find the corresponding RCS file in the
     directory ...///RRRCCCSSS and then in the current directory.  For more details, see
     FILE NAMING below.

     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rrcccsss(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ccooo retrieves the latest revision that satisfies all of them.
     If  none  of  the selection options is specified, cccooo retrieves the latest
     revision on the default branch (normally the trunk, see the ---bbb option  of
     rrrcccsss(1)).   A  revision  or  branch  number  may be attached to any of the
     options ---fff, ---III, ---lll, ---ppp, ---qqq,  ---rrr,  or  ---uuu.   The  options  ---ddd  (date),  ---sss
     (state),  and  ---www  (author)  retrieve  from a single branch, the _s_e_l_e_c_t_e_d
     branch, which is either specified by one of ---fff,,, ..., ---uuu, or  the  default
     branch.

     A cccooo command applied to an RCS file with no  revisions  creates  a  zero-
     length  working  file.   cccooo  always  performs  keyword  substitution (see
     below).

OOOPPPTTTIIIOOONNNSSS

     ---rrr[rev]]]
          retrieves the latest revision whose number is less than or equal  to
          _r_e_v.  If  _r_e_v  indicates a branch rather than a revision, the latest
          revision on that branch is retrieved.  If _r_e_v is omitted, the latest
          revision  on  the  default  branch  (see the ---bbb option of rrrcccsss(1)) is
          retrieved.  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nn option of the commands ccciii(1)
          and rrrcccsss(1).

     ---lll[rev]]]
          same as ---rrr, except that it also locks the retrieved revision for the
          caller.



                                    \*(Dt                                    1



CO(1)                      Unix Programmer's Manual                      CO(1)


     ---uuu[rev]]]
          same as ---rrr, except that it unlocks the retrieved revision if it  was
          locked  by  the  caller.  If _r_e_v is omitted, ---uuu retrieves the latest
          revision locked by the caller; if no such lock exists, it  retrieves
          the latest revision on the default branch.

     ---fff[rev]]]
          forces the overwriting of the working  file;  useful  in  connection
          with ---qqq.  See also FILE MODES below.

     ---kkkkkkvvv Generate keyword strings using the default form, e.g. $$$RRReeevvviiisssiiiooonnn::: 555...444
          $$$  for  the  RRReeevvviiisssiiiooonnn  keyword.   A locker's name is inserted in the
          value of the HHHeeeaaadddeeerrr, IIIddd, and LLLoooccckkkeeerrr keyword strings only as  a  file
          is being locked, i.e. by ccciii\\\ ---lll and cccooo\\\ ---lll.  This is the default.

     ---kkkkkkvvvlll
          Like ---kkkkkkvvv, except that a locker's name is  always  inserted  if  the
          given revision is currently locked.

     ---kkkkkk  Generate only keyword names in keyword strings; omit  their  values.
          See  KEYWORD  SUBSTITUTION  below.   For  example,  for the RRReeevvviiisssiiiooonnn
          keyword, generate the string $$$RRReeevvviiisssiiiooonnn$$$ instead of $$$RRReeevvviiisssiiiooonnn::: 555...444 $$$.
          This   option  is  useful  to  ignore  differences  due  to  keyword
          substitution when comparing different revisions of a file.

     ---kkkooo  Generate the old keyword string, present in the  working  file  just
          before  it  was  checked in.  For example, for the RRReeevvviiisssiiiooonnn keyword,
          generate the string $$$RRReeevvviiisssiiiooonnn::: 111...111 $$$ instead of $$$RRReeevvviiisssiiiooonnn::: 555...444 $$$  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.

     ---kkkvvv  Generate only keyword values for keyword strings.  For example,  for
          the  RRReeevvviiisssiiiooonnn keyword, generate the string 555...444 instead of $$$RRReeevvviiisssiiiooonnn:::
          555...444 $$$.  This can help generate files in programming languages  where
          it  is  hard  to  strip keyword delimiters like $$$RRReeevvviiisssiiiooonnn:::\\\ $$$ 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ll, and the owner write permission of the
          working file is turned off; to edit the file  later,  check  it  out
          again without ---kkkvvv.

     ---ppp[rev]]]
          prints the retrieved revision on the  standard  output  rather  than
          storing  it  in  the working file.  This option is useful when cccooo is
          part of a pipe.

     ---qqq[rev]]]
          quiet mode; diagnostics are not printed.

     ---III[rev]]]
          interactive mode; the user is prompted and questioned  even  if  the
          standard input is not a terminal.



                                    \*(Dt                                    2



CO(1)                      Unix Programmer's Manual                      CO(1)


     ---ddd_d_a_t_e
          retrieves the latest revision on the selected branch  whose  checkin
          date/time  is  less  than or equal to _d_a_t_e. The date and time may be
          given in free format.  The time zone LLLTTT stands for local time; other
          common  time  zone names are understood.  For example, the following
          _d_a_t_es are equivalent if local time is January 11, 1990, 8pm  Pacific
          Standard Time (eight hours west of GMT):

          8:00 pm lt
          4:00 AM, Jan. 12, 1990                  note: default is GMT
          1990/01/12 04:00:00                     RCS date format
          Thu Jan 11 20:00:00 1990 LT             output of ctime(3) + LT
          Thu Jan 11 20:00:00 PST 1990            output of date(1)
          Fri Jan 12 04:00:00 GMT 1990
          Thu, 11 Jan 1990 20:00:00 -0800
          Fri-JST, 1990, 1pm Jan 12
          12-January-1990, 04:00-WET

     Most fields in the date and time may be defaulted.  The default time zone
     is GMT.  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.  For example, the date 222000,,, 111000:::333000 defaults to 10:30:00
     GMT  of  the  20th  of  the  GMT time zone's current month and year.  The
     date/time must be quoted if it contains spaces.

     ---sss_s_t_a_t_e
          retrieves the latest revision on the selected branch whose state  is
          set to _s_t_a_t_e.

     ---www[login]]]
          retrieves the latest revision  on  the  selected  branch  which  was
          checked  in by the user with login name _l_o_g_i_n. If the argument _l_o_g_i_n
          is omitted, the caller's login is assumed.

     ---jjj_j_o_i_n_l_i_s_t
          generates a new revision which is  the  join  of  the  revisions  on
          _j_o_i_n_l_i_s_t.  This  option  is  largely obsoleted by rrrcccsssmmmeeerrrgggeee(1) but is
          retained for backwards compatibility.

     The _j_o_i_n_l_i_s_t is a comma-separated list of pairs of  the  form  _r_e_v_2:::_r_e_v_3,
     where  _r_e_v_2 and _r_e_v_3 are (symbolic or numeric) revision numbers.  For the
     initial such pair, _r_e_v_1  denotes  the  revision  selected  by  the  above
     options  ---fff,,,  ...,  ---www.   For  all other pairs, _r_e_v_1 denotes the revision
     generated by the previous pair.  (Thus, the output of  one  join  becomes
     the input to the next.)

     For each pair, cccooo joins revisions _r_e_v_1 and _r_e_v_3  with  respect  to  _r_e_v_2.
     This  means that all changes that transform _r_e_v_2 into _r_e_v_1 are applied to
     a copy of _r_e_v_3. This is particularly useful if _r_e_v_1 and _r_e_v_3 are the ends
     of  two  branches that have _r_e_v_2 as a common ancestor.  If _r_e_v_1<_r_e_v_2<_r_e_v_3
     on the same branch, joining generates a new revision which is like  _r_e_v_3,
     but with all changes that lead from _r_e_v_1 to _r_e_v_2 undone.  If changes from
     _r_e_v_2 to _r_e_v_1 overlap with changes from _r_e_v_2 to _r_e_v_3, cccooo prints a  warning


                                    \*(Dt                                    3



CO(1)                      Unix Programmer's Manual                      CO(1)


     and includes the overlapping sections, delimited by  the  lines  <<<<<<<<<<<<<<<<<<<<<\
     _r_e_v_1, =====================, and >>>>>>>>>>>>>>>>>>>>>\ _r_e_v_3.

     For the initial pair, _r_e_v_2 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 ---lll and ---uuu  lock  or
     unlock _r_e_v_1.

     ---VVV_n  Emulate RCS version _n, where _n may be 333,  444,  or  555.   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rrllloooggg on an RCS file; if
          none of the first few lines of output contain the string bbbrrraaannnccchhh:::  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
          emulating  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 _y_y///_m_m///_d_d instead
          of  _y_y_y_y///_m_m///_d_d  and  may  also  contain different white space in the
          substitution for $$$LLLoooggg$$$.

KKKEEEYYYWWWOOORRRDDD SSSUUUBBBSSSTTTIIITTTUUUTTTIIIOOONNN
     Strings of the form $$$_k_e_y_w_o_r_d$$$ and $$$_k_e_y_w_o_r_d:::...$$$ embedded in the text  are
     replaced with strings of the form $$$_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 listed below.  Keywords may be embedded in literal  strings  or
     comments to identify a revision.

     Initially, the user enters strings of the form $$$_k_e_y_w_o_r_d$$$.   On  checkout,
     cccooo replaces these strings with strings of the form $$$_k_e_y_w_o_r_d:::_v_a_l_u_e$$$.  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kk options.

     Keywords and their corresponding values:

     $$$AAAuuuttthhhooorrr$$$
          The login name of the user who checked in the revision.

     $$$DDDaaattteee$$$
          The date and time (GMT) the revision was checked in.

     $$$HHHeeeaaadddeeerrr$$$
          A standard header containing the full pathname of the RCS file,  the
          revision  number,  the  date  (GMT),  the author, the state, and the
          locker (if locked).

     $$$IIIddd$$$ Same as $$$HHHeeeaaadddeeerrr$$$, except that the RCS file name is without a path.

     $$$LLLoooccckkkeeerrr$$$
          The login name of the user who locked the  revision  (empty  if  not
          locked).





                                    \*(Dt                                    4



CO(1)                      Unix Programmer's Manual                      CO(1)


     $$$LLLoooggg$$$
          The log message  supplied  during  checkin,  preceded  by  a  header
          containing  the  RCS file name, the revision number, the author, and
          the date (GMT).  Existing log messages are _n_o_t  replaced.   Instead,
          the new log message is inserted after $$$LLLoooggg:::...$$$.  This is useful for
          accumulating a complete change log in a source file.

     $$$RRRCCCSSSfffiiillleee$$$
          The name of the RCS file without a path.

     $$$RRReeevvviiisssiiiooonnn$$$
          The revision number assigned to the revision.

     $$$SSSooouuurrrccceee$$$
          The full pathname of the RCS file.

     $$$SSStttaaattteee$$$
          The state assigned to the revision with the ---sss option of  rrrcccsss(1)  or
          ccciii(1).

FFFIIILLLEEE NNNAAAMMMIIINNNGGG
     Pairs of RCS files and working files may be specified in three ways  (see
     also the example section).

     1) Both the RCS file and the working file are given.  The RCS  file  name
     is  of the form _p_a_t_h_1///_w_o_r_k_f_i_l_e,,,vvv and the working file name is of the form
     _p_a_t_h_2///_w_o_r_k_f_i_l_e where _p_a_t_h_1/// and _p_a_t_h_2/// are (possibly different or  empty)
     paths and _w_o_r_k_f_i_l_e is a file name.

     2) Only the RCS file is given.  Then the working file is created  in  the
     current  directory  and its name is derived from the name of the RCS file
     by removing _p_a_t_h_1/// and the suffix ,,,vvv.

     3) Only the working file is given.  Then cccooo looks for an RCS file of  the
     form _p_a_t_h_2///RRRCCCSSS///_w_o_r_k_f_i_l_e,,,vvv or _p_a_t_h_2///_w_o_r_k_f_i_l_e,,,vvv (in this order).

     If the RCS file is specified without a path in 1) and 2), then  cccooo  looks
     for  the  RCS  file  first in the directory ...///RRRCCCSSS and then in the current
     directory.

EEEXXXAAAMMMPPPLLLEEESSS
     Suppose the current directory contains a subdirectory  RRRCCCSSS  with  an  RCS
     file  iiiooo...ccc,,,vvv.   Then  all  of  the following commands retrieve the latest
     revision from RRRCCCSSS///iiiooo...ccc,,,vvv and store it into iiiooo...ccc.

          co  io.c;    co  RCS/io.c,v;   co  io.c,v;
          co  io.c  RCS/io.c,v;    co  io.c  io.c,v;
          co  RCS/io.c,v  io.c;    co  io.c,v  io.c;

FFFIIILLLEEE MMMOOODDDEEESSS
     The working file inherits the read and execute permissions from  the  RCS
     file.   In  addition, the owner write permission is turned on, unless ---kkkvvv
     is set or the file is checked out unlocked and locking is set  to  strict
     (see rrrcccsss(1)).




                                    \*(Dt                                    5



CO(1)                      Unix Programmer's Manual                      CO(1)


     If a file with the name of the working file exists already and has  write
     permission,  cccooo  aborts  the checkout, asking beforehand if possible.  If
     the existing working file is not writable or ---fff  is  given,  the  working
     file is deleted without asking.

FFFIIILLLEEESSS
     cccooo accesses files much as ccciii(1) does, except that it  does  not  need  to
     read the working file.

DDDIIIAAAGGGNNNOOOSSSTTTIIICCCSSS
     The RCS file name,  the  working  file  name,  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IIDDDEEENNNTTTIIIFFFIIICCCAAATTTIIIOOONNN
     Author: Walter F. Tichy.
     Revision Number: 5.4; Release Date: 1990/12/04.
     Copyright (c) 1982, 1988, 1989 by Walter F. Tichy.
     Copyright (c) 1990 by Paul Eggert.

SSSEEEEEE AAALLLSSSOOO
     ci(1), ctime(3),  date(1),  ident(1),  rcs(1),  rcsdiff(1),  rcsintro(1),
     rcsmerge(1), rlog(1), rcsfile(5)
     Walter F. Tichy, RCS--A System for Version Control, _S_o_f_t_w_a_r_e--_P_r_a_c_t_i_c_e  &
     _E_x_p_e_r_i_e_n_c_e 111555, 7 (July 1985), 637-654.

LLLIIIMMMIIITTTSSS
     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.

BBBUUUGGGSSS
     The ---ddd option sometimes gets confused, and accepts no date before 1970.























                                    \*(Dt                                    6

