5

I have to svn repositories , lets say A and B. I want to add some of the directories of the B into A along with history.Is it possible to do that. To make more clear, following is the scenario.

    repo A                                repo B
       \branches                          \branches 
             \sub-branch1                      \sub-branch B1
              \sub-branch2                      \sub-branch B2 
       \trunk                             \trunk 

What i would like to do is, add sub-branch2 in the branches of repo A. How could do it?

thanks in advance

bahrep
  • 29,961
  • 12
  • 103
  • 150
thetna
  • 6,903
  • 26
  • 79
  • 113

2 Answers2

6

Get the dump of sub-branch2 of repoB:

  svnadmin dump /location/of/repoB | svndumpfilter include subbranch2 > my.dump

Merge the dump into branches of repoA:

  svnadmin load /location/of/repoA --parent-dir branches < my.dump
vpk
  • 1,240
  • 2
  • 18
  • 32
  • I tried it but got disastor, may be i did some wrong.My previous history are all lost. Does the parent-dir specifies to top level directory only. My real architecture of the repository is 1 more level deep than i mentioned there in one question.Can you suggest me if i can revert the process? – thetna Apr 07 '11 at 11:02
  • What do you mean by revert? Just delete the directory you don't need from repoA- no change has been made to repoB. The load process must have shown some messages which will help you understand what went wrong. – vpk Apr 07 '11 at 11:14
  • **empty revision for padding.** is the error i got and the the directory is also not added in the specified directory.Can you please tell me what is the reason for it? – thetna Apr 07 '11 at 11:57
  • You can try to remove the empty revisions that are padded with this command: svnadmin dump /location/of/repoB | svndumpfilter --drop-empty-revs --renumber-revs include subbranch2 > my.dump – vpk Apr 07 '11 at 12:05
1

Yes, this is possible. You need to use svnadmin dump and svnadmin load.
For more info, look here: http://blogs.nuxeo.com/dev/2006/04/dump-load-svn-repositories-using-svnadmin-svndumpfilter.html

Daniel Hilgarth
  • 171,043
  • 40
  • 335
  • 443
  • I read the article .It is very helpful.But i have an doubt , how to direct the location of dumped file. I think **svnadmin load < p** will reside the dumped file into the root location.How can I manupulate the location so that i can keep in the desired location?> – thetna Apr 07 '11 at 10:42
  • read my reply for the answer. you can specify a parent directory in svnadmin load command. – vpk Apr 07 '11 at 10:44
  • 1
    Use the --parent-dir option to the load command. See jjossarin's answer for an example. – Daniel Hilgarth Apr 07 '11 at 10:44