How to copy SVN repository as a folder to another repository with history

projectrepositorysvn

I have 2 repositories

http://mysnv/svn/proj1/trunk
  • proj1_folder1
  • proj1_folder2

and

http://mysnv/svn/proj2/trunk
  • proj2_folder1
  • proj2_folder2

How can I copy the proj2 with history to be a folder in the trunk of proj1 to get the following result

http://mysnv/svn/proj1/trunk
  • proj1_folder1
  • proj1_folder2
  • proj2
    • proj2_folder1
    • proj2_folder2

Actually what I want to do is to have only one SVN repository with all the content of proj2 and the history in the folder proj2 in http://mysnv/svn/proj1/trunk

This is the SVN version I'm using:

svn, version 1.7.8 (r1419691)

I've found this blog, but the svn merge is unclear to me. Where is it located ./foo/trunk:proj1?

My svn folder structure is like /data/svn/repos/ and I do not see the trunk folder.

I'm looking for a command to make the copy, without influencing my main project proj1.

Best Answer

Physical aggregation

  • Create dumps of needed paths from proj2 repository (svnadmin dump | svndumpfilter --include --include > dump or svnrdump URL-proj2_folder1 > dump1 & svnrdump URL-proj2_folder1 > dump2)
  • Load dump(s) into proj1 with changed parent folder (svnadmin load --parent-dir trunk < dump)
  • Check presence of proj2_folder1's and proj2_folder2's data under proj1/trunk/trunk (second trunk is base path in dump of repo1)
  • Rename child trunk-folder into proj2 (svn mv)

Sample of loading svnrdump-ed trunk into new repo with parent dir trunk/Project1

enter image description here

Logical aggregation

  • Create proj1/trunk/proj2 folder
  • Create two svn:externals (directory-type) inside proj2: proj2_folder1 linked to proj2/trunk/proj2_folder1 and proj2_folder2 linked to proj2/trunk/proj2_folder2