Converting RCS to X

From Applied Optics Wiki
Revision as of 16:13, 28 January 2009 by Ral (talk | contribs)

Jump to: navigation, search

You have an old RCS repository you'd like to convert to something more modern. RCS is so old that there aren't many tools that deal with it, so there are a few stages to go through.

The examples here use the name "vxi11" as the repository being converted. Change this as necessary!

First off, make sure all of the files are checked in. This probably involves "ci".

rcs2cvs

Next, we're going to make a temporary CVS repository with the contents of the RCS repository:

mkdir ~/cvs
export CVSROOT=~/cvsroot
mkdir ~/cvs/vxi11
cp /path/to/repo/vxi11/RCS/*,v ~/cvs/vxi11/

You can now check out a copy of the CVS repository like so:

mkdir ~/tmp
cd ~/tmp
cvs co vxi11 vxi11

cvs2svn

cvs is old and nasty as well, so converting to something else makes sense. For many years, the standard version control system has been Subversion (svn) and because it is the most commonly used VCS, everything has a tool to convert from SVN to their own native format. cvs2svn is in the openSUSE repositories:

sudo zypper install cvs2svn
mkdir ~/svn
cvs2svn ~/cvs/vxi11 -s ~/svn/vxi11

You can now check out a copy of the svn repository like so:

mkdir ~/tmp
cd ~/tmp
svn co file:///home/<username>/svn/vxi11 vxi11

svn2bzr

svn is a big improvement over cvs, but distributed version control systems (DVCS) are the way forwards these days. The big three are git, mercurial (hg) and bazaar (bzr). I'm going to recommend bzr because it is more popular than mercurial and more friendly than git in my opinion, especially to the very casual VCS user.

We're going to use bzr-svn to migrate to bzr. This isn't in the default repos, so we'll need to add another repo:

sudo zypper ar -t rpm-md http://download.opensuse.org/repositories/home:/maw:/bzr/openSUSE_11.1 bzr-repo
sudo zypper install bzr-svn

Now to do the conversion:

mkdir -p ~/bzr/vxi11
cd ~/bzr/vxi11
bzr init
bzr pull file:///home/<username>/svn/vxi11/trunk

If you get an error about "different rich-root support", try the following:

bzr upgrade --rich-root-pack
bzr pull file:///home/<username>/svn/vxi11/trunk

~/bzr/vxi11 is now a bzr repository.

See Using bzr for instructions on day to day use of bzr.