CO(1RCS) COMMAND REFERENCE CO(1RCS) NAME co - check out RCS revisions SYNOPSIS co [ -P ] [ -ddate ] [ -jjoinlist ] [ -l[rev] ] [ -p[rev] ] [ -q[rev] ] [ -r[rev] ] [ -sstate ] [ -ulogin ] [ -w[login] ] filename ... DESCRIPTION Co retrieves revisions from RCS files. Each filename ending in ,v is taken to be an RCS file. All other files are assumed to be working files. Co retrieves a revision from each RCS file and stores it into the corresponding working file. You may specify pairs of RCS files and working files in three ways: 1) Give both the RCS filename and the working filename. The format of an RCS filename is: pathname1/workfilename,v. The format of a working filename is: pathname2/workfilename. Pathname1/ and pathname2/ are (possibly different or empty) paths and workfilename is a filename. 2) Give only the RCS filename. The working file is created in the current directory and its name is derived from the name of the RCS file by removing pathname1/ and the suffix ,v. 3) Give only the working filename. The name of the RCS file is derived from the name of the working file by removing pathname2/ and appending the suffix ,v. If you omit the RCS filename or specify it without a path, co looks for the RCS file in the directory ./RCS and then in the current directory. You may check out revisions of an RCS file locked or unlocked. Locking a revision prevents overlapping updates. You need not lock a revision that is checked out for reading or processing (for example, compiling). A revision you checked out for editing and later checkin should be locked. Co won't let you lock a revision that is currently locked by another user. (A lock may be broken with the rcs(1rcs) command.) To check out a file locked, you must be: 1) On the access list of the RCS file, or 2) The owner of the file, or 3) Logged in as the superuser. Printed 4/6/89 1
CO(1RCS) COMMAND REFERENCE CO(1RCS) You can also checkout a file locked if the access list is empty. Co without locking is not subject to access-list restrictions. You may select a revision by number, checkin date/time, author, or state. When these options are applied in combination, the latest revision that satisfies all of them is retrieved. If you don't specify any of these options co retrieves the latest revision on the trunk. The options for date/time, author, and state retrieve a revision on the selected branch. The selected branch is either derived from the revision number (if given), or is the highest branch on the trunk. You may specify a revision number with one of the options: -l, -p, -q, or -r. A co command applied to an RCS file with no revisions creates a zero-length file. Co always performs keyword substitution (see below). Co creates the working file with the same read and execute permissions as the RCS file. In addition, write permission for the owner of the file is turned on, unless the file is checked out unlocked and locking is set to strict (see rcs(1rcs)). If a file with the name of the working file exists already and you have write permission, co: 1) Aborts the checkout if -q is given, or 2) Asks whether to abort if -q is not given. If the working file exists but is not writable, it is deleted before the checkout. Keyword Substitution 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. (Note: the Locker keyword is only expanded in the working file that was actually checked out with the lock.) Keywords may be embedded in literal strings or comments to identify a revision. Initially, you enter 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 are replaced during the next checkout. Thus, the keyword values are automatically updated on checkout. Printed 4/6/89 2
CO(1RCS) COMMAND REFERENCE CO(1RCS) Keywords and their corresponding values are: $Author$ The loginname of the user who checked in the revision. $Date$ The date and time the revision was checked in. $Header$ A standard header containing the RCS filename, the revision number, the date, the author, and the state. $Locker$ The loginname of the user who locked the revision (empty if not locked). $Log$ The log message supplied during checkin, preceded by a header containing the RCS filename, the revision number, the author, and the date. Existing log messages are not replaced. Instead, the new log message is inserted after $Log:...$. This is useful for accumulating a complete change log in a source file. $Revision$ The revision number assigned to the revision. $Source$ The full pathname of the RCS file. $State$ The state assigned to the revision with rcs -s or ci -s. OPTIONS -P Causes the access and modification dates of the working file and RCS to be the same as the original RCS file. See CAVEATS. -ddate 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 and are converted to local time. Examples of formats for date are: 22-April-1982, 17:20-CDT, 2:25 AM, Dec. 29, 1983, Tue-PDT, 1981, 4pm Jul 21 (free format), Fri, April 16 15:52:25 EST 1982 (output of ctime). Most fields in the date and time may be omitted. Co determines the defaults in this order: year, month, day, Printed 4/6/89 3
CO(1RCS) COMMAND REFERENCE CO(1RCS) 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 current values are assumed. For all other omitted fields, the lowest possible values are assumed. For example, the date 20, 10:30 defaults to 10:30:00 of the 20th of the current month and current year. The date/time must be quoted if it contains spaces. -jjoinlist Generates a new revision which is the join of the revisions on joinlist. Joinlist is a comma-separated list of pairs of the form rev2:rev3, where rev2 and rev3 are (symbolic or numeric) revision numbers. For the initial such pair, rev1 denotes the revision selected by the options -l, ..., -r. For all other pairs, rev1 denotes the revision generated by the previous pair. (Thus, the output of one join becomes the input to the next.) For each pair, co joins revisions rev1 and rev3 with respect to rev2. This means that all changes that transform rev2 into rev1 are applied to a copy of rev3. This is particularly useful if rev1 and rev3 are the ends of two branches that have rev2 as a common ancestor. If rev1 < rev2 < rev3 are on the same branch, joining them generates a new revision which is like rev3, but with all changes that lead from rev1 to rev2 undone. If changes from rev2 to rev1 overlap with changes from rev2 to rev3, co prints a warning and includes the overlapping sections, delimited by the lines <<<<<<< rev1, =======, and >>>>>>> rev3. For the initial pair you may omit rev2 and the following colon, in which case the common ancestor of rev1 and rev3 is used for rev2. If you omit rev2 but leave the following colon, rev1 is used for rev2 as well as for rev1. If any of the arguments indicate branches, the latest revisions on those branches are assumed. If the option -l is present, the initial rev1 is locked. -l[rev] Locks the checked out revision for the caller. If -l is omitted, the checked out revision is not locked. See option -r for handling of the revision number rev. -p[rev] Prints the retrieved revision on the standard output Printed 4/6/89 4
CO(1RCS) COMMAND REFERENCE CO(1RCS) rather than storing it in the working file. This option is useful when co is part of a pipe (|) or when you want the output displayed on your terminal. -q[rev] Quiet mode. Diagnostics are not printed. -r[rev] 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. Rev is composed of one or more numeric or symbolic fields separated by a dot (.). The numeric equivalent of a symbolic field is specified with the -n option of the commands ci and rcs. -sstate Retrieves the latest revision on the selected branch whose state is state. -ulogin When locking a revision, use login as the locker instead of the invoker's login name. This allows creating separate working branches without requiring all lockers to be present to check out the files. -w[login] Retrieves the latest revision on the selected branch that was checked in by the user with loginname login. If login is omitted, the caller's login is assumed. EXAMPLES Suppose the current directory contains a subdirectory RCS with an RCS file io.c,v. Then all of the following commands retrieve the latest revision from RCS/io.c,v and store it into io.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; FILES ,*, Lock file; exists during checkout. Prevents others from working on the same file. ,RCSt$$ Temporary file for storing working file data during retrieval. $$ is the process id. DIAGNOSTICS The RCS filename, the working filename, and the revision number retrieved are written to the diagnostic output. Printed 4/6/89 5
CO(1RCS) COMMAND REFERENCE CO(1RCS) RETURN VALUE [NO_ERRS] Command completed without error. [NP_ERR] An error occurred that was not a system error. Execution terminated. CAVEATS To checkout a revision, you must have write permission in the working directory, read permission for the RCS file, and either read permission (for reading) or read/write permission (for locking) in the directory which contains the RCS file. The option -j does not work for files that contain lines with a single dot (.). The option -d gets confused in some circumstances, and accepts no date earlier than 1970. There is no way to suppress the expansion of keywords, except by writing them differently. In nroff(1), this is done by embedding the null-character into the keyword. In order to interface correctly with make(1), the working file is always newer than the RCS file after a checkout. The maximum number of revisions that can be stored in a single RCS file is 719. When there are more than 700 revisions in a file, a warning message is printed on the terminal (if possible) every time an RCS command works on the file. See the manual page for rcsfile(5rcs) for information on what action to take in this case. On older versions of RCS, the maximum number of revisions that can be stored in a single RCS file is 239. No warning message is displayed on the terminal if that number is exceeded. The -P option is supplied so that make does not think that a file has been changed just because it was checked out. This causes make to do less work, but it can cause problems if the values of any of the RCS keyword values are used. For example, if a revision logging system is used to store the version numbers of source files into the object code, these numbers may not be correct if the -P option is used. Unless the -l option is given, the Locker keyword is not expanded. SEE ALSO ci(1rcs), ident(1rcs), make(1), rlog(1rcs), rcs(1rcs), rcsdiff(1rcs), rcsintro(1rcs), rcsmerge(1rcs), and rcsfile(5rcs). Printed 4/6/89 6
%%index%% na:264,80; sy:344,554; de:898,2261;3495,2908;6739,1210; op:7949,894;9179,3064;12579,1512; ex:14091,470; fi:14561,291; di:14852,245; rv:15433,288; ca:15721,2168; se:17889,377; %%index%%000000000208