LinuxCommandLibrary

rcs

Manage revisions of text files

SYNOPSIS

rcs [options] [file...]
rcs -i [options] [RCS_file...]

PARAMETERS

-i
    Initializes an RCS file for a given working file, creating the ,v file if it doesn't exist. This is the first step to place a file under RCS control.

-l[rev]
    Locks the specified revision (or the default, usually the latest) in the RCS file, preventing others from checking in changes until unlocked. Typically used in conjunction with co.

-u[rev]
    Unlocks the specified revision (or the default) in the RCS file, allowing others to check in changes. Often used to release a forgotten lock or after a check-in.

-q
    Operates in quiet mode, suppressing non-error diagnostic messages during execution.

-r[rev]
    Sets the default revision for subsequent operations (e.g., co without a -r option will check out this revision).

-b[rev]
    Sets the default branch to which new revisions will be added when checking in via ci.

-t[file]
    Specifies a file (or standard input if file is omitted) containing the descriptive text for the RCS file. This text summarizes the project or file's purpose.

-nname[:[rev]]
    Associates a symbolic name (tag) with a specific revision. If rev is omitted, the current head revision is used. Useful for marking releases or important versions.

-orange
    Deletes revisions within the specified range from the RCS file. The range can be a single revision, a branch, or a pair of revisions (e.g., 1.1:1.3). Use with caution as this is irreversible.

-alogin
    Adds a user's login name to the access list of the RCS file, granting them permission to make changes.

-e[login]
    Removes a user's login name from the access list of the RCS file. If login is omitted, all entries are removed, restricting changes to the file's owner.

-ksubst
    Controls keyword expansion when revisions are checked out. Common values include kv (keyword and value), o (old value), or b (binary file, suppressing all expansion).

DESCRIPTION

The rcs command, part of the Revision Control System (RCS) suite, is used to administer RCS files, which store revisions of text files. It allows users to create, modify attributes of, and perform various administrative tasks on these version-controlled files.

Unlike modern distributed version control systems like Git, rcs operates on a per-file basis, managing a single file's revision history in a corresponding RCS file (typically named with a ,v suffix, e.g., myfile.c,v).

While not commonly used for large-scale team development today, rcs remains valuable for versioning individual scripts, configuration files, or small personal projects where a full-fledged version control system might be overkill. Its primary functions include initializing RCS files, locking/unlocking revisions to prevent simultaneous edits, setting default branches/revisions, and managing access lists.

CAVEATS

rcs is a file-based version control system and lacks many features of modern systems. It does not provide atomic commits across multiple files, making multi-file changes difficult to manage consistently. Concurrent modifications by multiple users require careful manual locking (using rcs -l) to prevent conflicts. It is generally not suitable for large, collaborative projects or distributed development workflows.

RCS FILES (<I>,V</I> FILES)

For every source file (e.g., example.c) managed by rcs, there is a corresponding RCS file (e.g., example.c,v). These RCS files store all revisions, logs, and administrative information for that specific source file. rcs commands directly manipulate these ,v files, while ci and co commands interact with them to manage the working copies. It's crucial to always interact with the ,v file via rcs, ci, or co, and never directly modify it.

BASIC WORKFLOW

A typical workflow for managing a file with RCS involves:
1. rcs -i file: Initialize the RCS file for file. This creates file,v.
2. ci -l file: Check in the first revision (if starting fresh) or subsequent changes, and lock the working file for exclusive editing.
3. Edit file in your preferred editor.
4. ci -u file: Check in your changes and unlock the file. This creates a new revision in file,v.
5. co -l file: Check out a revision and lock it for further editing.
6. rcs -u file: Manually unlock a file if it was locked inadvertently or a previous operation failed, releasing the lock without checking in changes.

HISTORY

The Revision Control System (RCS) was initially developed by Walter F. Tichy at Purdue University in 1982. It quickly became a standard tool for managing source code and documentation on Unix-like systems throughout the 1980s and 1990s. Its primary design focused on efficient storage and retrieval of individual file revisions.

RCS served as the foundation for the Concurrent Versions System (CVS), which extended its capabilities to support concurrent access by multiple users and operate on entire projects, paving the way for more modern version control systems like Subversion (SVN) and Git.

SEE ALSO

ci(1), co(1), rcsdiff(1), rcsmerge(1), rcsclean(1), ident(1), cvs(1), git(1)

Copied to clipboard