Since the new Django/IronPython repository (django-ipy-patches) is based on MQ, I thought I'd give a quick intro into what MQ is and how to work with it on bitbucket. First off, MQ is short "Mercurial Queues". The queue, in this case, is a queue of patches to be applied to a repo that can be versioned separately from the repo itself. These patches live independent of the history and can be easily added and removed as changes are made. You can find a lot more detailed information in the Mercurial book.
The initial setup is a bit weird, but it works quite well after that. First off, get Mercurial – I prefer TortoiseHG, myself. Next, get a bitbucket account. Finally, go to the django-ipy-patches page and click the "fork" button. You can name your fork whatever you want. Once it's created, make a note of the URL in the "hg clone" line. For this example, it's https://bitbucket.org/jdhardy/django-ipy-patches-test.
Next, clone the django-trunk repository, but name it after your fork, and then switch to that directory:
> hg clone http://bitbucket.org/jdhardy/django-ipy-patches-test > cd django-ipy-patches-test
Now, clone the fork you created earlier and pull in all of the patches. Note that we're pulling it into a specific directory (.hg\patches):
> hg clone http://bitbucket.org/jdhardy/django-ipy-patches-test .hg\patches > hg qpush --all
You can now use MQ to manage patches as usual.
> hg qnew fix-1 -m "Fix issue #1" > hg ci --mq > hg push --mq
Now you can go back to the bitbucket page for your fork, click "pull request", and send me a request to pull your changes back into django-ipy-patches. Please do a pull from django-ipy-patches first to sync things up as much as possible.
If you don't want to use bitbucket, you can get the django-ipy-patches queue directly:
> hg qclone http://bitbucket.org/jdhardy/django-ipy-patches
Make your changes using MQ as usual, but instead of doing a push, export the changes instead:
> hg log --mq > hg export –mq –r ...
The trick here is figuring out which changes you need to export using hg log and then export them. You should then post the bundle to the issue tracker, and I'll apply it as soon as I can.
You may have noticed that most of the normal hg commands take an --mq parameter that causes them to operate on the MQ repository instead of the actual repository. I use a simple batch file as a shortcut so that I can use `mq push` instead of `hg push --mq`:
@hg %1 --mq %2 %3 %4 %5 %6 %7 %8 %9
Put that line in a file named "mq.cmd" somewhere in your PATH and you can save yourself a little bit of typing.