Tuesday, September 29, 2009

GIT + SVN Externals

I've taken Andre and Mark's git-svn-clone tool and made a few changes. Mostly I wanted something a little more familiar to git. You can see this at http://github.com/ustramooner/git-svn-clone-externals

git-ext-svn-clone: was git-svn-clone-externals, but with a few bug fixes.

#svn commands:
git-ext-svn-dcommit - loop through externals and call svn dcommit (arguments are passed along)
git-ext-svn-rebase -  loop through externals and call svn rebase (arguments are passed along)
git-ext-svn-fetch -  loop through externals and call svn fetch (arguments are passed along)

#normal git commands:
git-ext-branch -  loop through externals and call branch (arguments are passed along)
git-ext-status -  loop through externals and call status (arguments are passed along)
git-ext-commit -  loop through externals and call commit (arguments are passed along)
git-ext-checkout -  loop through externals and call commit (arguments are passed along)
git-ext-stash -  loop through externals and call stash (arguments are passed along)

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


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