# HG changeset patch # User Bryan O'Sullivan # Date 1181684687 25200 # Node ID 1cf908c00479e6510701140ae22a4346741ad5be # Parent d48e1b5f8265dda6285687a216868c579e6b6fd5 Don't validate email config if we're not sending email. diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py --- a/hgext/patchbomb.py +++ b/hgext/patchbomb.py @@ -223,7 +223,9 @@ def patchbomb(ui, repo, *revs, **opts): pass os.rmdir(tmpdir) - if not opts['test']: + really_sending = not (opts['test'] or opts['mbox']) + + if really_sending: mail.validateconfig(ui) if not (revs or opts.get('rev') or opts.get('outgoing')): @@ -351,7 +353,7 @@ def patchbomb(ui, repo, *revs, **opts): ui.write('\n') - if not opts['test'] and not opts['mbox']: + if really_sending: mailer = mail.connect(ui) parent = None diff --git a/tests/test-patchbomb b/tests/test-patchbomb --- a/tests/test-patchbomb +++ b/tests/test-patchbomb @@ -15,3 +15,5 @@ hg commit -Amb -d '2 0' hg email --date '1970-1-1 0:2' -n -f quux -t foo -c bar -s test 0:tip | \ sed -e 's/\(Message-Id:.*@\|In-Reply-To:.*@\).*/\1/' + +hg email -m test.mbox -f quux -t foo -c bar -s test 0:tip diff --git a/tests/test-patchbomb.out b/tests/test-patchbomb.out --- a/tests/test-patchbomb.out +++ b/tests/test-patchbomb.out @@ -132,3 +132,12 @@ options: --remotecmd specify hg command to run on the remote side use "hg -v help email" to show global options +This patch series consists of 2 patches. + + +Write the introductory message for the patch series. + + +Writing [PATCH 0 of 2] test ... +Writing [PATCH 1 of 2] a ... +Writing [PATCH 2 of 2] b ...