c

co(1)

co(1)

NAME

co - check out RCS revisions

SYNOPSIS

co [ options ] ®le ...

DESCRIPTION

co retrieves revisions from RCS ®les. Each ®le name ending in ,v is taken to be an RCS ®le. All other ®les are assumed to be working ®les. co retrieves a revision from each RCS ®le and stores it in the corresponding working ®le (see also rcsintro(5)).

Revisions of an RCS ®le can 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 checked in must normally be locked. Locking a revision currently locked by another user fails (a lock can be broken with the rcs command, but poses inherent risks when independent changes are being made simultaneously (see rcs(1)). co with locking requires the caller to be on the access list of the RCS ®le unless: he is the owner of the ®le, a user with appropriate privileges, or the access list is empty. co without locking is not subject to access list restrictions.

A revision is selected by number, check-in date/time, author, or state. If none of these options are speci®ed, the latest revision on the trunk is retrieved. When the options are applied in combination, the latest revision that satis®es all of them is retrieved. 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. A revision number can be attached to the options -l, -p, -q, or -r.

The caller of the command must have write permission in the working directory, read permission for the RCS ®le, and either read permission (for reading) or read/write permission (for locking) in the directory that contains the RCS ®le.

The working ®le inherits the read and execute permissions from the RCS ®le. In addition, the owner write permission is turned on, unless the ®le is checked out unlocked and locking is set to strict (see rcs(1)).

If a ®le with the name of the working ®le exists already and has write permission, co aborts the check out if -qis given, or asks whether to abort if -qis not given. If the existing working ®le is not writable, it is deleted before the check out.

A number of temporary ®les are created. A semaphore ®le is created in the directory of the RCS ®le to prevent simultaneous update.

Aco command applied to an RCS ®le with no revisions creates a zero-length ®le. co always performs keyword substitution (see below).

Options

 

 

-l[rev ]

Locks the checked out revision for the caller.

If omitted, the checked out revision is not

 

locked. See option -rfor handling of the revision number rev.

-p[rev ]

Prints the retrieved revision on the standard output rather than storing it in the working

 

®le. This option is useful when co is part of a pipe.

-q[rev ]

Quiet mode; diagnostics are not printed.

 

-ddate

Retrieves the latest revision on the selected branch whose check in 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:

 

 

Tue-PDT, 1981, 4pm Jul 21

(free format)

 

Fri April 16 15:52:25 EST 1982

(output of ctime(3C))

 

4/21/86 10:30am

(format: mm/dd/yy hh:mm:ss)

 

Most ®elds in the date and time can be defaulted. co determines the defaults in the order

 

year, month, day, hour, minute, and second (from most- to least-signi®cant). At least one

 

of these ®elds must be provided. For omitted ®elds that are of higher signi®cance than the

 

highest provided ®eld, the current values are assumed. For all other omitted ®elds, 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. Date/time ®elds can be delim-

 

ited by spaces or commas. If spaces are used, the string must be surrounded by double

 

quotes.

 

Section 198

− 1 −

HP-UX Release 11i: December 2000