Merging Subversion Repositories
For a while now I’ve had a number of Subversion repositories that contain more or less related code. They should each, individually, contain less related code than they do, but I find that if I’ve only got a checkout of one of them on some random machine I’m fare more likely to check something into whatever repository I’ve already got checked out than I am to checkout the proper repository. If I later want to move it to the correct repository I lose (or at least scatter all over) any revision history.
Enough of that… for a while I’ve been meaning to merge the repositories together so that even if I don’t have the entire repository checked out and decide to check something in where it shouldn’t be I can later move it within the repository layout and keep the revision history in tact. I’ve figured this should be an easy task to accomplish and now that I’ve finally gotten around to doing it, I was pleasantly surprised to find that it is indeed an easy task to accomplish. Here’s how:
svnadmin dump repos-name > DumpFile-repos-namesvndumptool.py merge -i DumpFile-repos1 -r / /repos1 -i DumpFile-repos2 -r / /repos2 -i DumpFile-repos3 -r / /repos3 -o DumpMerged -d repos1 -d repos2 -d repos3svnadmin create new-repossvnadmin load DumpMergedSweet. I love it when things are as simple as they should be… it’s usually a sign of competent designers.
Add comment August 29th, 2007