[PATCH] Patchbomb: Prompt password when using SMTP/TLS and no password in .hgrc

Arun Thomas arun.thomas at gmail.com
Wed Dec 19 11:06:35 CST 2007


1 file changed, 2 insertions(+)
mercurial/mail.py |    2 ++


# HG changeset patch
# User Arun Thomas <arun.thomas at gmail.com>
# Date 1198083379 18000
# Node ID dbe69c3fbe660755542e233593db028bd032767c
# Parent  04c76f296ad6f8e32180d6c0fd3982e5faaff3cd
Patchbomb: Prompt password when using SMTP/TLS and no password in .hgrc.

If .hgrc specifies SMTP/TLS and a username without specifying a password,
prompt for a password.

diff -r 04c76f296ad6 -r dbe69c3fbe66 mercurial/mail.py
--- a/mercurial/mail.py	Mon Dec 10 10:26:42 2007 -0600
+++ b/mercurial/mail.py	Wed Dec 19 11:56:19 2007 -0500
@@ -30,6 +30,8 @@ def _smtp(ui):
         s.ehlo()
     username = ui.config('smtp', 'username')
     password = ui.config('smtp', 'password')
+    if username and not password:
+        password = ui.getpass()
     if username and password:
         ui.note(_('(authenticating to mail server as %s)\n') %
                   (username))


More information about the Mercurial-devel mailing list