comparison hgext/patchbomb.py @ 4565: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
comparison
equal deleted inserted replaced
4564:d48e1b5f8265 4565:1cf908c00479
221 os.unlink(tmpfn) 221 os.unlink(tmpfn)
222 except: 222 except:
223 pass 223 pass
224 os.rmdir(tmpdir) 224 os.rmdir(tmpdir)
225 225
226 if not opts['test']: 226 really_sending = not (opts['test'] or opts['mbox'])
227
228 if really_sending:
227 mail.validateconfig(ui) 229 mail.validateconfig(ui)
228 230
229 if not (revs or opts.get('rev') or opts.get('outgoing')): 231 if not (revs or opts.get('rev') or opts.get('outgoing')):
230 raise util.Abort(_('specify at least one changeset with -r or -o')) 232 raise util.Abort(_('specify at least one changeset with -r or -o'))
231 233
349 ui.config('patchbomb', 'bcc') or '').split(',') 351 ui.config('patchbomb', 'bcc') or '').split(',')
350 bcc = [a.strip() for a in bcc if a.strip()] 352 bcc = [a.strip() for a in bcc if a.strip()]
351 353
352 ui.write('\n') 354 ui.write('\n')
353 355
354 if not opts['test'] and not opts['mbox']: 356 if really_sending:
355 mailer = mail.connect(ui) 357 mailer = mail.connect(ui)
356 parent = None 358 parent = None
357 359
358 sender_addr = email.Utils.parseaddr(sender)[1] 360 sender_addr = email.Utils.parseaddr(sender)[1]
359 for m in msgs: 361 for m in msgs: