I managed two sites in separate repositories, but I eventually decided that the excess complexity was unlikely to prove helpful anytime soon. Having administered subversion for quite some time, and given my low demands for the history accuracy, it was pretty straightforward.
- /drive/folder_a -> repo_a (folder_a is the root checkout)
- /drive/folder_b -> repo_b (folder_b is the root checkout)
- Target setup: The new repo will be relative to the server root ("/") such that folder_a will now be at "drive/folder_a" within the new repo.
- Ensure that both folders are fully committed
- Create a new master repo: svnadmin create /path/to/repo
- Go to a temporary folder (paths below are relative to that directory)
Export the old repos
- svnadmin dump /path/to/repo_a > repo_a.repo
- svnadmin dump /path/to/repo_b > repo_b.repo
Initialize the new repo
- svn co file:///path/to/repo
- cd repo
- svn mkdir drive drive/folder_a drive/folder_b
- svn commit -m "Initialize directory structure for repo merge."
Import the old repos
- svnadmin load --parent-dir drive/folder_a/ /path/to/repo < ../repo_a.repo
- svnadmin load --parent-dir drive/folder_b/ /path/to/repo < ../repo_b.repo
Update the working copies
Remove the old .svn directories from
- rm -rf $(find /drive/folder_a -type d -name .svn)
- rm -rf $(find /drive/folder_b -type d -name .svn)
Copy the new .svn directories into place
- svn update # to update the temp working copy from just the base directories
- find . -type d -name .svn | while read d; do echo $d; cp -rf "$d" "WORKING_COPY_ROOT/$d"; done
- Remove the old .svn directories from
All of these commands assume that you are within the temp checkout folder. If you change that, or if your repositories do not share a theoretical parent folder, or if you are not on the same server, then you will likely need to tweak some of the commands.
- The version numbers are not mixed together. The version numbers are 0 to X and X+1 to X+Y. It is possible to merge them, but it is more complex and was unnecessary for my use case.
- This only addresses your working copy. Other computers with a working copy would need to checkout a new copy. If they want to keep them in place, then they would need to checkout a new version and then update using a modified version of the last steps.