views:

577

answers:

3

I'm administering a svn repo for a project where the source wasn't imported with a single top level directory. As a result, there are about 15 separate 'projects' instead of one. How can I merge these into one folder while maintaining the change history?

*hint: svn move doesn't work in this case.

[edit] whoops, dupe of http://stackoverflow.com/questions/267256/combining-multiple-svn-repositories-into-one

+1  A: 

If you don't care about retaining all the history of one of the repositories, you can just create a new directory under one project's repository, then import the other.

If you care about retaining the history of both, then you can use 'svnadmin dump' to dump one repository, and 'svnadmin load' to load it into the other repository. The revision numbers will be off, but you'll still have the history.

Copied from here: http://subversion.tigris.org/faq.html#multi-merge

Ivan Dubrov
+2  A: 

Maybe I've been working too much with the distributed version control hammer and all that I see at this point are distributed nails. But I once again have to say that this is probably a job for DVCSs.

I would try messing around with git-svn or something like that. Import each "project" into its own git repository and them git pull from one another. Resolve any conflicts and, after everything is done, import the history back into Subversion.

But your team may be better off just using the distributed control after you finish merging all the repos anyway...

Thiago Arrais
A: 

You could create a new top-level project that uses svn:externals to point to all the other projects and places them in appropriate subdirectories.

  • devs will only need to check out your new top-level project (svn will automatically follow the svn:externals and pull in the others)
  • the full version history will be retained, and new changes will be automatically committed to the relevant sub-project
  • it will take you about 5 mins to implement (create the new top level project and run svn propedit svn:externals top_dir).
Stewart Johnson
If you do this, keep in mind that updates are recursive over externals, but commits aren't, also if you need to tag or branch at the top level you will have to do some extra work.
krusty.ar