CVS to SVN conversion and reorganizing branches
Asked Answered
B

7

6

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.

Beuthen answered 18/8, 2008 at 9:26 Comment(0)
D
9
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.

Danika answered 18/8, 2008 at 10:8 Comment(4)
I'm using cvs2svn, but I want only to convert specific branch and the HEAD, but cvs2svn only have "exclude" function for branches, not "include". So how do I convert the HEAD with one more branch?Nasal
I guess you could dump it all and use then svndumpfilter to filter out whatever you don't want?Danika
I don't think the svndumpfilter removes unmentioned branches. Do you know of any other solution?Nasal
Not sure what you mean by "unmentioned branches", but svndumpfilter has both --include and --exclude parameters. If you tell cvs2svn to use the "/trunk", "/branches" and "/tags" as root folders, extracting the trunk (HEAD from CVS) and a specific branch can be done with 'svndumpfilter --include "/trunk" --include "/branches/<branch-name>" 'Danika
U
5

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.

Unhappy answered 18/8, 2008 at 9:34 Comment(0)
K
1

Subversion branches are directories, so you could just move the branches after the import has finished and no history will be lost.

Kultur answered 18/8, 2008 at 9:34 Comment(0)
T
1

Some additional information to support the accepted answer:

cvs2svn does not allow conversion of from trunk to a branch or the branch to trunk

so moving things once you're converted to svn is the best way to go.

Telestich answered 24/9, 2008 at 19:47 Comment(0)
A
1

It is possible to move the trunk and branch directories after the conversion, but this would require an explicit post-conversion SVN commit that will remain in your SVN history, making history exploration a bit more complicated.

But you can indeed tell cvs2svn to store the trunk and branches to the SVN paths that you want by using the --symbol-hints=symbol-hints.txt command-line option or (if you are using an options file for your conversion) the SymbolHintsFileRule('symbol-hints.txt') symbol strategy rule, where symbol-hints.txt is a file containing lines like the following:

. .trunk. trunk branches/branchX .
. branchX branch trunk .

Please note that some commit messages that are autogenerated by cvs2svn (for example, for the creation of the branch) will mention the original branch name.

Anneal answered 17/10, 2008 at 10:9 Comment(0)
J
1

Although moving around branches after the conversion is done is possible, it may be better to setup the cvs2svn configuration file to specify exactly the name you want for each of your existing branches. One of the benefits of this is that FishEye will understand the output a lot better.

Jimmiejimmy answered 3/12, 2008 at 18:57 Comment(0)
B
0

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?

Beuthen answered 18/8, 2008 at 9:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.