Mercurial > hg
changeset 2286:9f745d3675d4
do not set smtp host by default - raise error instead
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Mon, 15 May 2006 08:47:42 -0700 |
parents | 0912f807b7ff |
children | 3f18d1eea370 |
files | mercurial/ui.py |
diffstat | 1 files changed, 4 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/ui.py Sun May 14 23:49:31 2006 -0700 +++ b/mercurial/ui.py Mon May 15 08:47:42 2006 -0700 @@ -271,8 +271,10 @@ def sendmail(self): s = smtplib.SMTP() - s.connect(host = self.config('smtp', 'host', 'mail'), - port = int(self.config('smtp', 'port', 25))) + mailhost = self.config('smtp', 'host') + if not mailhost: + raise util.Abort(_('no [smtp]host in hgrc - cannot send mail')) + s.connect(host=mailhost, port=int(self.config('smtp', 'port', 25))) if self.configbool('smtp', 'tls'): s.ehlo() s.starttls()