[Previous] [Contents] [Next]

rcs

Change RCS file attributes (UNIX)

Syntax:

rcs [options] file...

Options:

The rcs utility does not follow the standard utility syntax conventions. Options and their arguments may not be separated by white space, and options may not be combined in single command line arguments (i.e. multiple options must be separated by spaces in the command line).

-alogins
Append the login names appearing in the comma-separated list logins to the access list of the RCS file.
-Aoldfile
Append the access list of oldfile to the access list of the RCS file.
-b [rev]
Set the default branch to rev. If rev is omitted, the default branch is reset to the (dynamically) highest branch on the trunk.
-cstring
Set the comment leader to string. An initial ci, or an rcs -i without -c, guesses the comment leader from the suffix of the working filename.

This option is obsolescent, since RCS normally uses the preceding $Log$ line's prefix when inserting log lines during checkout (see co). However, older versions of RCS use the comment leader instead of the $Log$ line's prefix, so if you plan to access a file with both old and new versions of RCS, make sure its comment leader matches its $Log$ line prefix.

-e [logins]
Erase the login names appearing in the comma-separated list logins from the access list of the RCS file. If logins is omitted, erase the entire access list.
-i
Create and initialize a new RCS file, but don't deposit any revision. If the RCS file has no path prefix, try to place it first into the subdirectory ./RCS, and then into the current directory. If the RCS file already exists, print an error message.
-I
Run interactively, even if the standard input isn't a terminal.
-ksubst
Set the default keyword substitution to subst. The effect of keyword substitution is described in co. Giving an explicit -k option to co, rcsdiff, and rcsmerge overrides this default. Beware of rcs -kv, since -kv is incompatible with co -l. Use rcs -kkv to restore the normal default keyword substitution.
-l [rev]
("el") Lock the revision with number rev. If a branch is given, lock the latest revision on that branch. If rev is omitted, lock the latest revision on the default branch. Locking prevents overlapping changes. You remove a lock with ci or rcs -u (see below).
-L
Set locking to strict. Strict locking means that the owner of an RCS file isn't exempt from locking for checkin. You should use this option for files that are shared.
-mrev:msg
Replace revision rev's log message with msg.
-M
Do not send mail when breaking somebody else's lock. This option is not meant for casual use; it is meant for programs that warn users by other means, and invoke rcs -u only as a low-level lock-breaking operation.
-nname[:rev]
Associate the symbolic name name with the branch or revision rev. Print an error message if name is already associated with another number. If rev is omitted, the symbolic name is deleted.
-Nname[:rev]
Act as if -n were specified, except override any previous assignment of name.
-orange
Delete (i.e. "outdate") the revisions given by range. See "Description," below.
-q
Be quiet; don't print diagnostics.
-sstate[:rev]
Set the state attribute of the revision rev to state. If rev is a branch number, assume the latest revision on that branch. If rev is omitted, assume the latest revision on the default branch. Any identifier is acceptable for state. The following is a useful set of states:
Exp
(experimental)
Stab
(stable)
Rel
(released)
By default, ci sets the state of a revision to Exp.
-t [file]
Write descriptive text from the contents of the named file into the RCS file, deleting the existing text. The filename may not begin with -. If file is omitted, rcs obtains the text from standard input, terminated by EOF or by a line containing only a dot (.). You are prompted for the text if interaction is possible; see -I. With -i, descriptive text is obtained even if -t isn't given.
-t-string
Write the descriptive text from string into the RCS file, deleting the existing text.
-T
Preserve the modification time on the RCS file unless a revision is removed. This option can suppress extensive recompilation caused by a make dependency of some copy of the working file on the RCS file. Use this option with care; it can suppress recompilation even when it is needed, i.e. when a change to the RCS file would mean a change to keyword strings in the working file.
-u [rev]
Unlock the revision with number rev. If a branch is given, unlock the latest revision on that branch. If rev is omitted, remove the latest lock held by the caller.

Normally, only the locker of a revision may unlock it. Somebody else unlocking a revision breaks the lock. This causes a mail message to be sent to the original locker. The message contains a commentary solicited from the breaker. The commentary is terminated by EOF or by a line containing only a dot (.).

-U
Set locking to non-strict. Non-strict locking means that the owner of a file need not lock a revision for checkin. You should not use this option for files that are shared. Whether default locking is strict is determined by your system administrator, but it is normally strict.
-V[n]
Report RCS version; or, if a number is supplied immediately after -V (no spaces), emulate RCS version n, where n may be 3, 4, or 5. This option can be useful when you're interchanging RCS files with other users who are running older versions of RCS.
-xsuffixes
Use suffixes to characterize RCS files. See ci for details.
-zzone
Use zone as the default time zone. This option has no effect; it is present for compatibility with other RCS commands.

Description:

The rcs utility creates new RCS files or changes the attributes of existing ones. An RCS file contains multiple revisions of text, an access list, a change log, descriptive text, and some control attributes.

Filenames ending in ,v denote RCS files; all others denote working files. If a working file is given, rcs tries to find the corresponding RCS file first in an RCS subdirectory and then in the working file's directory, as explained for the co utility.

The RCS filename and the revisions outdated are written to the diagnostic output.

For rcs to work, the caller's login name must be on the access list, unless one or more of the following is true:

To delete one revision or a range of revisions, you use the -orange option. The following rules apply to range:

If range is: It means:
a single revision number that revision
a branch number the latest revision on that branch
of the form rev1:rev2 revisions rev1 to rev2 on the same branch
of the form :rev from the beginning of the branch containing rev up to and including rev
of the form rev: from revision rev to the end of the branch containing rev

Note that none of the outdated revisions may have branches or locks.

Compatibility

To make an RCS file acceptable to prior RCS versions (by discarding information that would confuse those versions), use rcs -V n.

Also note the following:

For more information on RCS versions, see the co utility.

Files:

The rcs utility accesses files much as ci does, except that it doesn't need to access the working file or its directory.

Exit status:

0
Successful completion.
>0
An error occurred.

The exit status is zero only if all operations were successful.

Contributing author:

GNU

See also:

ci, co, ident, rcsdiff, rcsmerge, rlog

Walter F. Tichy, "RCS -- A System for Version Control," Software -- Practice & Experience 15, 7, July 1985.

Don Bolinger & Tan Bronson, Applying RCS & SCCS, O'Reilly and Associates, 1995.


[Previous] [Contents] [Next]