views:

111

answers:

2

I have two existing subversion repositories on different hosts (host-a and host-b) and I'd like to copy one directory from repo A to repo B.

Basically https://host-a/repo/some/path/moduleA should be copied to https://host-b/repo/some/other/path/moduleA. All the history should be preserved and existing data in host-b should be preserved.

The two repositories do not have any conflicting directory hierarchies. The repositories do not share common ancestry.

+1  A: 

Have you checked out the svnadmin dump and svnadmin load combination? According to the Subversion red book, they can be used to merge one repository with another:

The dump format can also be used to merge the contents of several different repositories into a single repository. By using the --parent-dir option of svnadmin load, you can specify a new virtual root directory for the load process.

Update:

Juha, in response to your comment: There is a command called svndumpfilter (see this wiki entry or this section in the red book) that I think might help.

Ash
That seems to describe how to copy whole external repository to a repo. I'd like to only one directory of repo.
Juha Syrjälä
I've updated the answer (comments don't seem to like extra links...)
Ash
A: 

You can use svn:externals for this. That will eliminate the need to copy the files from one repo to another, and will also continue to keep those folders in sync in each of the repos. You will have access to the complete commit log as well.

RedFilter
I really want to use only one repository, so svn:externals is not for me.
Juha Syrjälä