Importing Existing CVS Repositories into Subversion
I used cvs2svn to create individual repositories for what used to be the subdirectories in my CVS repository.
I didn't want to import everything, though, so I did some pruning, first. I copied /opt/public/cvs/software into a temporary location, and then pruned unwanted directories and old Attic directories (I never much cared for CVS attics).
I then ran:
cvs2svn --create -n -s /opt/public/svn/software \ --trunk=trunk --branches=branches --tags=tags \ /root/tmp/software/
Note that I did this as root. I probably should have done this as the svn user, but this has just seemed to be easier for me in the past.
Anyway, this command did a dry run of the import. When this looked sensible, I removed the -n option to do the import for real. It took around 105 seconds to run.
When cvs2svn was done, the permissions on the repository need to be changed to make anything else work:
daystrom:/opt/public# chown -R svn:public /opt/public/svn daystrom:/opt/public# chmod -R g+w /opt/public/svn
At this point, I was able to check out the repository.
This works pretty much like you'd expect. For instance, use this command to get a directory called trunk that contains the cedar-backup checkout.
svn checkout svn+ssh://daystrom/opt/public/svn/software/cedar-backup/trunk
Or, use this command to get you the cedar-backup/trunk directory just named cedar-backup:
svn checkout svn+ssh://daystrom/opt/public/svn/software/cedar-backup/trunk cedar-backup
Note: the method described above will get you one big repository with URLs such as:
/opt/public/svn/software/trunk /opt/public/svn/software/tags /opt/public/svn/software/branches
I have mixed feelings on this. After I did this the first time, I actually ended up blowing the whole thing away and then re-importing each software directory individually, getting me something like:
/opt/public/svn/software/cedar-backup/trunk /opt/public/svn/software/banner/trunk
However, on newer repositories, I have used the original "one trunk per repository" approach, and I think that it works pretty well.
I honestly can't remember the actual reason I re-did my repository. It may have been because of the structure that cvs2svn imposed on me, i.e. things didn't look "right" unless I did one directory at a time. YMMV.