changeset 4563:1cf908c00479

Don't validate email config if we're not sending email.
author Bryan O'Sullivan <bos@serpentine.com>
date Tue, 12 Jun 2007 14:44:47 -0700
parents d48e1b5f8265
children 087b3ae4f08a
files hgext/patchbomb.py tests/test-patchbomb tests/test-patchbomb.out
diffstat 3 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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
 
--- 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
--- 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 ...