Mbox Extension

This extension is not distributed with Mercurial.

Author: Patrick M├ęzard

Repository: https://bitbucket.org/pmezard/hgmbox/


This extension let you import patches from a mailbox, storing them in a Mercurial queue (see MqExtension) like the qimport command. It works with standard unix mailboxes as well as Thunderbird ones and can also fetch patches from IMAP servers such as gmail.


Enable the extension by adding following lines to your configuration file (hgrc):

mbox = /path/to/mbox.py
hgext.mq =

and optionally reference existing mboxes like:

mbox.tb.path = /path/to/mbox
mbox.mutt.path = /path/to/other/mbox
imap.g.server = imap.gmail.com
imap.g.username = username
imap.g.password = password
imap.g.mailbox = INBOX


A single interactive mimport command is added, enumerating detected patches and asking whether to import or skip them. When done, just hit d and selected items are added to MQ.

Here is a sample session, looking for win32 patches:

$ hg mimport win32
[PATCH 0 of 2] win32text 'none' encoding with tests and docs
    [PATCH 1 of 2] Implement and test a builtin 'none:' filter
    [PATCH 2 of 2] document the 'none:' filter and semantics of '!' filter entry
import this group? [Nydq?]  y

[PATCH] win32text: be more careful about rejecting violating changesets
import this group? [Nydq?]  n

[PATCH 0 of 4] win32text 'exact' encoding and deterministic filter ordering
    [PATCH 1 of 4] Add an 'exact' encoder/decoder
    [PATCH 2 of 4] Apply longest patterns first and fix --debug output
    [PATCH 3 of 4] document '!' and 'exact:' encoders/decoders
    [PATCH 4 of 4] Tests for 'exact' encoder/decoder and filter application order
import this group? [Nydq?]  d
adding document_the_none_filter_and_semantics_of__filter_entry to series file
adding implement_and_test_a_builtin_none_filter to series file
2 patches imported

$ hg qseries

See also



MboxExtension (last edited 2010-03-28 20:27:42 by MadsKiilerich)