##// END OF EJS Templates
4.6 fix (one of…)
Marcin Kasperski -
r250:a9f4dc6c default
parent child Browse files
Show More
@@ -1,3 +1,9 b''
1
2
3 ~~~~~~~~~~~~
4
5 4.6-compatibility
6
1 1.1.8
7 1.1.8
2 ~~~~~~~~~~~~~
8 ~~~~~~~~~~~~~
3
9
@@ -58,7 +58,7 b' import os'
58 import sys
58 import sys
59 import re
59 import re
60
60
61 from mercurial import util, sslutil
61 from mercurial import util, sslutil, error
62 from mercurial.i18n import _
62 from mercurial.i18n import _
63 from mercurial.url import passwordmgr
63 from mercurial.url import passwordmgr
64 from mercurial import mail
64 from mercurial import mail
@@ -95,7 +95,7 b' def import_meu():'
95 try:
95 try:
96 import mercurial_extension_utils
96 import mercurial_extension_utils
97 except ImportError:
97 except ImportError:
98 raise util.Abort(_("""Can not import mercurial_extension_utils.
98 raise error.Abort(_("""Can not import mercurial_extension_utils.
99 Please install this module in Python path.
99 Please install this module in Python path.
100 See Installation chapter in https://bitbucket.org/Mekk/mercurial_keyring/ for details
100 See Installation chapter in https://bitbucket.org/Mekk/mercurial_keyring/ for details
101 (and for info about TortoiseHG on Windows, or other bundled Python)."""))
101 (and for info about TortoiseHG on Windows, or other bundled Python)."""))
@@ -328,7 +328,7 b' class HTTPPasswordHandler(object):'
328 auth_user, auth_pwd, keyring_url = self.get_url_config(
328 auth_user, auth_pwd, keyring_url = self.get_url_config(
329 ui, parsed_url, actual_user)
329 ui, parsed_url, actual_user)
330 if auth_user and actual_user and (actual_user != auth_user):
330 if auth_user and actual_user and (actual_user != auth_user):
331 raise util.Abort(_('keyring: username for %s specified both in repository path (%s) and in .hg/hgrc/[auth] (%s). Please, leave only one of those' % (base_url, actual_user, auth_user)))
331 raise error.Abort(_('keyring: username for %s specified both in repository path (%s) and in .hg/hgrc/[auth] (%s). Please, leave only one of those' % (base_url, actual_user, auth_user)))
332 if auth_user and auth_pwd:
332 if auth_user and auth_pwd:
333 return auth_user, auth_pwd, self.SRC_CFGAUTH, keyring_url
333 return auth_user, auth_pwd, self.SRC_CFGAUTH, keyring_url
334
334
@@ -356,7 +356,7 b' class HTTPPasswordHandler(object):'
356 def prompt_interactively(ui, user, realm, url):
356 def prompt_interactively(ui, user, realm, url):
357 """Actual interactive prompt"""
357 """Actual interactive prompt"""
358 if not ui.interactive():
358 if not ui.interactive():
359 raise util.Abort(_('keyring: http authorization required but program used in non-interactive mode'))
359 raise error.Abort(_('keyring: http authorization required but program used in non-interactive mode'))
360
360
361 if not user:
361 if not user:
362 ui.status(_("keyring: username not specified in hgrc (or in url). Password will not be saved.\n"))
362 ui.status(_("keyring: username not specified in hgrc (or in url). Password will not be saved.\n"))
@@ -607,7 +607,7 b' def try_smtp_login(ui, smtp_obj, usernam'
607 ui.status(_("SMTP login failed: %s\n\n") % inst.smtp_error)
607 ui.status(_("SMTP login failed: %s\n\n") % inst.smtp_error)
608 return False
608 return False
609 else:
609 else:
610 raise util.Abort(inst)
610 raise error.Abort(inst)
611
611
612
612
613 def keyring_supported_smtp(ui, username):
613 def keyring_supported_smtp(ui, username):
@@ -626,14 +626,14 b' def keyring_supported_smtp(ui, username)'
626 starttls = tls == 'starttls' or util.parsebool(tls)
626 starttls = tls == 'starttls' or util.parsebool(tls)
627 smtps = tls == 'smtps'
627 smtps = tls == 'smtps'
628 if (starttls or smtps) and not util.safehasattr(socket, 'ssl'):
628 if (starttls or smtps) and not util.safehasattr(socket, 'ssl'):
629 raise util.Abort(_("can't use TLS: Python SSL support not installed"))
629 raise error.Abort(_("can't use TLS: Python SSL support not installed"))
630 mailhost = ui.config('smtp', 'host')
630 mailhost = ui.config('smtp', 'host')
631 if not mailhost:
631 if not mailhost:
632 raise util.Abort(_('smtp.host not configured - cannot send mail'))
632 raise error.Abort(_('smtp.host not configured - cannot send mail'))
633 verifycert = ui.config('smtp', 'verifycert', 'strict')
633 verifycert = ui.config('smtp', 'verifycert', 'strict')
634 if verifycert not in ['strict', 'loose']:
634 if verifycert not in ['strict', 'loose']:
635 if util.parsebool(verifycert) is not False:
635 if util.parsebool(verifycert) is not False:
636 raise util.Abort(_('invalid smtp.verifycert configuration: %s')
636 raise error.Abort(_('invalid smtp.verifycert configuration: %s')
637 % (verifycert))
637 % (verifycert))
638 verifycert = False
638 verifycert = False
639 if getattr(sslutil, 'sslkwargs', None) is None:
639 if getattr(sslutil, 'sslkwargs', None) is None:
@@ -699,9 +699,9 b' def keyring_supported_smtp(ui, username)'
699 return s.sendmail(sender, recipients, msg)
699 return s.sendmail(sender, recipients, msg)
700 except smtplib.SMTPRecipientsRefused, inst:
700 except smtplib.SMTPRecipientsRefused, inst:
701 recipients = [r[1] for r in inst.recipients.values()]
701 recipients = [r[1] for r in inst.recipients.values()]
702 raise util.Abort('\n' + '\n'.join(recipients))
702 raise error.Abort('\n' + '\n'.join(recipients))
703 except smtplib.SMTPException, inst:
703 except smtplib.SMTPException, inst:
704 raise util.Abort(inst)
704 raise error.Abort(inst)
705
705
706 return send
706 return send
707
707
General Comments 0
You need to be logged in to leave comments. Login now