Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CVS to SVN conversion and reorganizing branches

Tags:

svn

cvs

I am converting from existing CVS repository to SVN repository. CVS repository has few brances and I'd like to rename branches while converting.

Wanted conversion is like this:

CVS branch         SVN branch
HEAD       ->      branches/branchX
branchA    ->      trunk
branchB    ->      branches/branchB
branchC    ->      branches/branchC

That is, CVS HEAD becomes a normal branch and CVS branchA becomes SVN trunk.

Both CVS and SVN repositories will be on same linux machine.

How could this be done?

Also conversion where CVS branchA becomes SVN trunk and all other CVS branches are ignored might be enough.

like image 326
Juha Syrjälä Avatar asked Aug 18 '08 09:08

Juha Syrjälä


2 Answers

I am especially interested in preserving commit history. If I rename and move branches around in SVN after the conversion, will the history be preserved?

Yes. Subversion also keeps track of changes to the directory structure, and all version history is preserved even if a file is moved in the tree.

I recommend converting the repository with cvs2svn, including branches and tags. Once the repository is in Subversion you can move the branches and tags around as you wish. This also keeps the history of the actual tags and branches being renamed, which may be interesting in a historical context later.

like image 105
Anders Sandvig Avatar answered Oct 22 '22 19:10

Anders Sandvig


It's been a while since I've done a CVS -> SVN conversion, and probably even longer since I did one with a nontrivial branch structure. Since SVN can move around directory trees fairly easily, you could do the whole conversion first, then sort out the trunk/branches structure entirely within SVN later.

If you do get to that point and are moving around whole directory trees within SVN, it's probably best if you commit after every tree rename/move step. Just something to keep in mind.

like image 5
Greg Hewgill Avatar answered Oct 22 '22 21:10

Greg Hewgill