RCS to SVN Converter

r661 | coelho | 2010-01-31 10:55:18 +0100 (Sun, 31 Jan 2010)


rcs2svn convert tree of simple RCS files to SVN.


rcs2svn [-fghmvpn] [-[crs] cmd] [-u svn-url] [-d dir] [rcs-files]


The rcs2svn command converts a tree of simple RCS (Revision Control System) files to SVN (Subversion).

The script is not very clean and may be error prone. You may consider running rcs2cvs and cvs2svn or others instead.

SVN commits are performed for every revision of every file, in the same global order as the RCS checkins were performed. RCS informations are stored as properties in SVN:


RCS checkin date.


RCS checkin author, also put as SVN commit author.


RCS revision numbers, such as '1.28'.


RCS revision status, such as 'Exp', 'Rel'...


RCS lines differences, such as '+15 -8'.


--help or -h

show help about command usage.

--man or -m

show full manual page.

--version or -V

show script revision.

--verbose or -v.

be verbose. Repeat for more.

--quiet or -q

no interactive stuff.

--go or -g

do it! Otherwise, nothing is done.

--no-user or -n

do not issue SVN username on commits. Useful for HTTP repositories, where the username is authenticated.

--pdel or -p

remove all "rcs:*" SVN properties in a last commit. Otherwise they are kept indefinitely.

--co cmd or -c cmd

RCS checkout command, default to "co".

--rlog cmd or -r cmd

RCS log command, default to "rlog".

--svn cmd or -s cmd

SVN client command, default to "svn".

--url svn-url or -u svn-url

specify destination repository and possible subdirectory. default to none, that it assume that the target directory is an svn working copy.

--directory path or -d path

directory to convert. default is '.'.

--find or -f

look for RCS files in directory hierarchy. Quite advisable.

--filter-message cmd or --fm cmd

run filter on RCS checkin messages.

--temporary dir or --tmp dir

temporary directory to be used. default is '/tmp'.

--time or -t

use RCS checkin time as SVN commit time. It is better to do so, but it requires to enable revision property edition. See SVN repository administration documentation.

If you want to add an RCS project as a subdirectory in an existing SVN repository, you may consider first converting to a new repository, and then to merge the repositories so as to keep an overall date order, but at the price of loosing the initial revision numbers.


RCS files to convert. Use simpler --find option if possible.


A project added as a directory in an existing repository:

 sh> rcs2svn -d /to/project -u file:///to/repos/proj -f -v -n -g

A new repository that stores the project into "trunk":

 # administration
 sh> svnadmin create /to/repos
 # enable revision property changes:
 sh> echo -e "#! /bin/sh\nexit 0" > /to/repos/hooks/pre-revprop-change
 sh> chmod +x /to/repos/hooks/pre-revprop-change
 sh> svn mkdir -m 'initial setup' file:///to/repos/{trunk,branches,tags}
 # conversion
 sh> cd /to/rcs/project/hierarchy/copy
 sh> svn co file:///to/repos/trunk .
 sh> rcs2svn -f -v -p -t -g



(c) 2005-2010 Fabien Coelho <rcs2svn at coelho dot net> http://www.coelho.net/

This is free software, both inexpensive and available with sources. The GNU General Public License v3 or more applies (GPLv3+). The brief summary is: You get as much as you paid for, and I am not responsible for anything. See http://www.gnu.org/copyleft/gpl.html for details.


Beware! Run at your own risks. This software may destroy all your data. You might lose your hairs or your friends because of it. Think again.

Converting a significant projet requires a lot of shell (process forks) and file activity. Doing so with a remote (http, svn, file+nfs) repository is not a good idea. Consider doing that with a local temporary repository, for instance in "/tmp", and then to move the stuff later, possibly with svnadmin dump/load.

There are many reasons why the conversion may fail. Thus consider that it WILL fail, and act accordingly. Perform your operations on a copy of your directory structure and on a temporary repository.


Here is a subset of the great bugs provided freely with this software:


The latest version of the perl script is available at http://www.coelho.net/rcs2svn.pl.

This additionnal script may be useful to handle iso-8859-1 encoded RCS comments: http://www.coelho.net/accents_fr.pl.


Subversion site at http://subversion.apache.org/.


This documentation is about $Revision: 661 $ of the script.