Mercurial > public > mercurial-scm > hg
comparison mercurial/ui.py @ 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 | 7761597b5da3 |
children | 903ab41ac7eb |
comparison
equal
deleted
inserted
replaced
2285:0912f807b7ff | 2286:9f745d3675d4 |
---|---|
269 | 269 |
270 return t | 270 return t |
271 | 271 |
272 def sendmail(self): | 272 def sendmail(self): |
273 s = smtplib.SMTP() | 273 s = smtplib.SMTP() |
274 s.connect(host = self.config('smtp', 'host', 'mail'), | 274 mailhost = self.config('smtp', 'host') |
275 port = int(self.config('smtp', 'port', 25))) | 275 if not mailhost: |
276 raise util.Abort(_('no [smtp]host in hgrc - cannot send mail')) | |
277 s.connect(host=mailhost, port=int(self.config('smtp', 'port', 25))) | |
276 if self.configbool('smtp', 'tls'): | 278 if self.configbool('smtp', 'tls'): |
277 s.ehlo() | 279 s.ehlo() |
278 s.starttls() | 280 s.starttls() |
279 s.ehlo() | 281 s.ehlo() |
280 username = self.config('smtp', 'username') | 282 username = self.config('smtp', 'username') |