2007-10-13

Idea on how to do collaborative work off of a svn checkout using hg or bzr

I am collaborating with someone on a patch for Python. It isn't a huge amount of new code, but it does touch several files. We could create a new branch in svn to do the work in, but that just seems so bloody heavy-handed.

So I thought about how I could us hg or bzr for the collaboration work. First you have to take your svn checkout and initialize it for hg or bzr. That's not big deal as it just creates some directory. You then add any initially modified files you have and commit. From there you create a branch into another directory. You then zip up that branch and send that to the person you are collaborating with. They can then unzip the branch into a svn checkout they have and thus you both start off of the same initial repository.

With hg you can send changes back and forth using bundles. You probably want to tag the revision you last updated externally to so as to make sure your bundle contains all changes you initially made. Then just send the bundle to the other person and they can unbundle it. That lets you do simultaneous development with offline commits and merge resolution.

With bzr I think you have to stick with straight diffs. Bzr's bundle command is undocumented and the output it created that I applied using ``bzr merge`` said there were no changes when in fact there were. And I couldn't figure out how to get the 'send' command to output to a file instead of trying to send an email. But diffs should work nonetheless.