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'.
show help about command usage.
show full manual page.
show script revision.
be verbose. Repeat for more.
no interactive stuff.
do it! Otherwise, nothing is done.
do not issue SVN username on commits. Useful for HTTP repositories, where the username is authenticated.
remove all "rcs:*" SVN properties in a last commit. Otherwise they are kept indefinitely.
RCS checkout command, default to "co".
RCS log command, default to "rlog".
SVN client command, default to "svn".
specify destination repository and possible subdirectory. default to none, that it assume that the target directory is an svn working copy.
directory to convert. default is '.'.
look for RCS files in directory hierarchy. Quite advisable.
run filter on RCS checkin messages.
temporary directory to be used. default is '/tmp'.
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 --url
option does not work if there is no subdirectory
to create in the repository.
RCS branches are not handled.
SVN stops on unexpected string encoding in commit messages. Fix the message file, relaunch the commit manually, and continue.
The converted directories are left in a mess, with .svn and RCS sub-directories everywhere, and files checked out in strange states.
"rlog" output parsing is fuzzy and may fail in some case.
SVN username cannot be issued directly on HTTP repositories.
"rcs:*" properties are kept forever or deleted, although they would be best removed on the first SVN update.
Instead of doing all the processing in the target directory, the program should copy all RCS files to some temporary directory hierarchy.
Maybe all initial revisions (file creations) should be performed together at the first revision? Or it could be offered as an option?
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.