Classic Revision Control using RCS

The Revision Control System (RCS) is one of the ancestors of modern versioning systems like Subversion. It lacks many of the features its successors provide, such as assigning tags to a set of files, but in some environments it is still very useful. RCS requires no server or central repository, is rock-solid and trivial to set up and use. Everybody familiar with CVS or Subversion should have no problems at all.

Since RCS works best on single files, it is well suited for configuration files and the private little scripts that accumulate in ~/bin. I’ll give you an example to demonstrate how it works:

$ cd ~/bin
$ mkdir RCS
$ ci -l myscript
RCS/myscript,v  <--  myscript
enter description, terminated with single '.' or end of file:
NOTE: This is NOT the log message!
>> A script doing useful things.
>> .
initial revision: 1.1
$ vi myscript
[ make some changes to the file ]
$ ci -l myscript
RCS/myscript,v  <--  myscript
new revision: 1.2; previous revision: 1.1
enter log message, terminated with single '.' or end of file:
>> Added more features ...
>> .

In the example above, we create an RCS directory which will be the repository for all files in this directory. Then we put the file myscript under version control. Note the -l flag: We need it, otherwise rcs would delete the working copy and we’d have to check out the file again using co. RCS generally works with exclusive locks, so don’t forget to specify the -l flag. Committing changes is done using ci, and there are also commands to get the change log (rlog myscript) or to view differences (rcsdiff myscript).

More information about RCS can be found in the author’s classic paper and in the rcsintro manpage. The other tools have their manpages, too, but the 200 line rcsintro page contains everything that is needed on a daily basis.

This entry was posted in tools and tagged , , . Bookmark the permalink.

1 Response to Classic Revision Control using RCS

  1. Pingback: From RCS to Mercurial « Unmaintainable

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s