Jim
Jim

Reputation: 505

Restructuring a Subversion Repository

I've read about the svn move command but haven't been able to use it the right way... Here's my situation: I have a project with 5 components. Right now, I've made separate Repositories for each component and they all have a flat structure. I'd like to move all these components into a single repository so that I'd finally have a structure like:

/Project
    /Component1
        /branches
        /tags
        /trunk
    /Component2
        /branches
        /tags
        /trunk

And the existing code of each component would be in the trunk directory of each component, all set for us to branch/tag it.

An example of the svn move command to accomplish this would be REAL helpful.

Thanks in advance,

Jim

Upvotes: 2

Views: 2024

Answers (4)

M4N
M4N

Reputation: 96626

Another try (since I missed the "separate repositories" part in my first answer):

  • create the new repository and set up the trunk/branches/tags folders for all components
  • dump the existing repositories
  • load the dump-files into the respective trunk folders of the new repository (see example at the bottom of this page)

This is how I "merged" several repositories into one.

BTW: this is done using the subversion command line client

Upvotes: 2

Jon Onstott
Jon Onstott

Reputation: 13727

Number 2 in this list of tips is how to move things: http://onlamp.com/pub/a/onlamp/2004/08/19/subversiontips.html

An alternative is to do Exports from the individual repositories to get the project files by themselves without SVN information. Then you could add them to your new repository.

Upvotes: 1

Mark Roddy
Mark Roddy

Reputation: 27986

Since you're moving across different subversion repositories you're going to need more then just the move command as this only works within a single command. There's a good article here about how to do a move across repositories.

Upvotes: 3

M4N
M4N

Reputation: 96626

I think the easiest way to reorganize your repository is to use the "repository browser" of TortoiseSVN. There you can move and rename folders just like in windows explorer.

So if you have

/Project
  /Component1
    /<source files>

you can:

  • rename Component1 to trunk
  • create a new folder Component1
  • move trunk into Component1
  • add branches and tags folder
  • do the same for the other components

Upvotes: 0

Related Questions