The "rmmagic" Script

The rmmagic program is a Bourne Shell script that removes RCS "magic branches". A magic branch is syntactically the same as a version number, but its penultimate branch number is 0. "" is an example. This mechanism acts as a place-holder for branches in the event that no revisions actually exist on the branch. For example, "" identifies version 1.2 if version does not exist; otherwise, it identifies the latest revision on the 1.2.3 branch.

Some version control systems such as CVS use this capability to reserve branches when no versions exist on them. The application of the rmmagic script is to convert these magic branches into real ones for the benefit of conversion tools that do not support this obscure feature of RCS.

The following procedure is performed:

- Scan the RCS symbolic name list for magic branches.
- For each one found:
  - munge the magic branch into an actual branch number and test for
    version 1 on that branch.
  - If no versions exist on the magic branch, check out the version sprouting
    the branch, and check it back in on the branch.
  - Move the symbolic name from the magic branch to the actual branch.

Here is an example:

- Scanning for magic branches, a magic branch named "foo" is found that
  points to "".
- Check existence of version .
- If version does not exist:
  - Check out version 1.2 .
  - Check in version .
- Move symbolic name "foo" to point to branch 1.2.3 .

This script is expected to see limited use; its nature of prepping RCS files for conversion to a new version management system indicates that it would get very heavy use by automatic tools for a short time. Hence, no documentation is given (though instructions for use are provided as comments within the script). It was developed for use with RCS files generated by RCS version 5.6, but it is likely to work correctly with other versions.

Note that this script relies on Paul Sander's "rinfo" program in addition to RCS and a few standard Unix tools. The rinfo program can be found at and at The rinfo program in turn requires the BTREE and LIST components of the Software ChipSet, which is available at the same Web and FTP site.

This script has been placed in the public domain by its author, Paul Sander (

README (a description of the script)
rmmagic (the script)