Wednesday, September 23, 2009

SVN Versioned Copy Across Repositories

I have written a small tool for those of us that are still stuck with SVN (GIT is way better, but sometimes there is no other way!). I found that I needed to copy some files between two repositories, but we wanted to keep the revision history. This is a nasty little php program which keeps as much revision history as it can while copying between repositories.

It works very simply:
1. Gets a list of revisions from the SRC locations
2. For each revision:
1. Run svn export -r X SRC... tmpfolder
2. Removes DST/* (except .svn for history)
3. Copy the exported folders contents into DST
4. Adds and deletes changed files in DST
5. Gets the SRC version comments, dates, author, etc
6 Commit DST using the information in (5) as the comment

done...

You can find it here: http://github.com/ustramooner/svncp

No comments:

Post a Comment