repository with email-based push/pull

Asked by Alex T on 2010-12-12

A friend and I are working on a small project, there are only two of us and each has a personal development machine (neither of the machines is on 24/7), we don't want to pay to set-up a dedicated machine for running the main branch like a lot of the tutorials I've seen suggest (it also defeats the purpose of a distributed CVS), and we don't want to use launchpad since we're trying to keep the code private for now. I've currently setup a local branch on my machine and it works well as long as no one else needs to update it. Since neither of the machines is online all the time, my idea was to setup an email-based system, where my branch could automatically generate a patch file on commit and send it via email to my friend. My friend could then run a command to automatically scan for that special email message, retrieve patch and patch his local branch (and vice versa for his commits). The two promising plugins I saw for this is bzr-email (which sends an email notification upon commit), and bzrtools (which can automatically apply a patch to local branch). However, they don't seem to automate this solution completely (bzr-email will generate a message with preview of code changes, not attached patch, and bzrtools will only apply the patch, not download it from the email). To simplify things, we don't mind making these special emails easy to detect (have a unique title format from other emails or even setting up a separate email address we use only for patch transactions). I was considering writing a couple python scripts to do the push/pull through email if no other solution is currently available (but since I haven't used email.utils package in python at all yet, I'm not sure how hard it would be).

Thanks

Question information

Language:
English Edit question
Status:
Answered
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Last query:
2010-12-12
Last reply:
2010-12-12
Michael B. Trausch (mtrausch) said : #1

You can send "merge directives" back and forth; the 'bzr send' command is probably what you are looking for. Either one of you can create a merge directive like this:

  $ bzr send -o merge-directive.txt

The way that you would use this is for the both of you to start off with a branch, say "trunk" that is mirrored between the two of you. Then, you guys work individually in your own branches. Then, when you're ready to merge to your local mirror of "trunk", you create the merge directive against trunk, and then merge it into trunk. That merge directive can then be sent to the other party, who can also apply it to their trunk, and the merge is then complete on both sides. (By default the merge directive will be computed against the parent branch, which is part of the reason that you both would want to have a mirrored copy of the "trunk", or "mainline", branch.)

You may want to read "bzr help send" for more information; also see http://doc.bazaar.canonical.com/latest/en/user-guide/sending_changes.html which talks about the use of merge directives.

Can you help with this problem?

Provide an answer of your own, or ask Alex T for more information if necessary.

To post a message you must log in.