UC Santa Cruz CMP 111
Nachos Project Documentation

Basic RCS Instructions

Braden Carter / Jim Spring

RCS Commands

The most commonly used RCS commands are
ci to check in a file,
co to check out a file,
rcsdiff to compare differences between revisions, and
rlog to check the RCS log for a file.


Command Syntax

This is an incomplete list of the options for each command. Please consult the man pages for a more complete listing and description.

	ci	[ -rrevision -l -u ] filename
	co	[ -rrevision -l -u ] filename
	rcsdiff	[ -rrevision ] filename
	rlog	[ -h ] filename
In all cases, the -r option allows you to specify the revision number of the file you wish to check in, check out, or compare to the currently checked-out file. The -l option specifies a locked copy (with write permissions for the user) of a file. The -u option specifies an unlocked copy (with write permissions for the user) of a file.


Example 1: Modifying an RCS file

Let's check out a locked version of the file thread.cc, so that we may modify it.
co -l thread.cc
This gives us a writeable version of the file that no one else may change, assuming "strict locks" on files.

After making changes, let's check in the new revision.

ci -u thread.cc
You will be prompted for a log entry when checking in revisions. This allows you to make a quick note of the changes that were made.

We should get back an unlocked copy of the file. If we don't specify either an unlocked copy (with the -u option) or a locked copy (with the -l option), there will not be a file in the directory after checking it in.


Example 2: Comparing differences between RCS files

Suppose we've made changes to the RCS file thread.cc, and we'd like to see how it differs from the previously checked-in revision.
rcsdiff thread.cc
Note that you may also compare the current version of thread.cc to any previous revision using the -r option. The format should be that of a normal diff.


Example 3: Checking an RCS file's log

Suppose we'd like to see what changes were made to the RCS file thread.cc. We can check our log entries corresponding to each revision of the file.
rlog thread.cc
After many revisions have been checked in, you may want to pipe the output through a pager such as more.


Example 4: Checking to see if an RCS file is checked out

The easiest way to see if the RCS file thread.cc is currently checked out is to view the header information for the file's RCS log.
rlog -h thread.cc
If it is checked out, the username of the person who has the file checked out will appear after the "locks: strict" line.


bwcarter@cse.ucsc.edu / jims@cse.ucsc.edu

Last Modified 1996/04/18 02:30:02.