Merging a part of SVN repository to another repository with history
Asked Answered
R

2

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

Racialism answered 7/4, 2011 at 10:21 Comment(0)
R
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
Rudelson answered 7/4, 2011 at 10:40 Comment(4)
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?Racialism
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.Rudelson
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?Racialism
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.dumpRudelson
T
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

Tambourine answered 7/4, 2011 at 10:24 Comment(3)
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?>Racialism
read my reply for the answer. you can specify a parent directory in svnadmin load command.Rudelson
Use the --parent-dir option to the load command. See jjossarin's answer for an example.Tambourine

© 2022 - 2024 — McMap. All rights reserved.