I have code in an svn repository, call it repository A. Now say that I need to move the contents to repository B, but repository B has already been active for a while for other projects. Is it possible to move a particular directory from repository A to repository B, preserving the file history? Normally, to migrate an entire repository to a new server, I would do:
svnadmin dump -r 0:179 rep_a > rep_a.dump
svnadmin create rep_b
svnadmin load rep_b < rep_a.dump
However, this acts on the whole repository and assumes repository B is empty to start with (I think). I can of course export the directory in question and import it into repository B, but I lose the version history.
Is there an easy way to move a particular directory from A to B without losing the version history?
Let’s say you want to copy directory
trunk/projectofrep_aintorep_b, you have to use this command:The revisions related to
rep_awill be added to the history ofrep_b.Be careful with that and make a backup before, of course. Also, it can be tricky if you have common directories, then you will have to remove directory creations from the dump (to avoid creating the same directories twice).