Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenVMS
Mercurial
hg
Commits
23889160905a
Commit
23889160905a
authored
17 years ago
by
Christian Ebert
Browse files
Options
Downloads
Patches
Plain Diff
Catch smtp exceptions
parent
5b81c1cc6ebe
Loading
Loading
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
hgext/patchbomb.py
+3
-6
3 additions, 6 deletions
hgext/patchbomb.py
mercurial/mail.py
+7
-1
7 additions, 1 deletion
mercurial/mail.py
with
10 additions
and
7 deletions
hgext/patchbomb.py
+
3
−
6
View file @
23889160
...
...
@@ -224,9 +224,8 @@
pass
os
.
rmdir
(
tmpdir
)
really_sending
=
not
(
opts
[
'
test
'
]
or
opts
[
'
mbox
'
])
if
really_sending
:
if
not
(
opts
[
'
test
'
]
or
opts
[
'
mbox
'
]):
# really sending
mail
.
validateconfig
(
ui
)
if
not
(
revs
or
opts
.
get
(
'
rev
'
)
or
opts
.
get
(
'
outgoing
'
)):
...
...
@@ -361,8 +360,6 @@
ui
.
write
(
'
\n
'
)
if
really_sending
:
mailer
=
mail
.
connect
(
ui
)
parent
=
None
sender_addr
=
email
.
Utils
.
parseaddr
(
sender
)[
1
]
...
...
@@ -411,7 +408,7 @@
ui
.
status
(
'
Sending
'
,
m
[
'
Subject
'
],
'
...
\n
'
)
# Exim does not remove the Bcc field
del
m
[
'
Bcc
'
]
mail
er
.
sendmail
(
sender
,
to
+
bcc
+
cc
,
m
.
as_string
(
0
))
mail
.
sendmail
(
ui
,
sender
,
to
+
bcc
+
cc
,
m
.
as_string
(
0
))
cmdtable
=
{
"
email
"
:
...
...
This diff is collapsed.
Click to expand it.
mercurial/mail.py
+
7
−
1
View file @
23889160
...
...
@@ -67,4 +67,5 @@
return
_sendmail
(
ui
,
method
)
def
sendmail
(
ui
,
sender
,
recipients
,
msg
):
try
:
return
connect
(
ui
).
sendmail
(
sender
,
recipients
,
msg
)
...
...
@@ -70,4 +71,9 @@
return
connect
(
ui
).
sendmail
(
sender
,
recipients
,
msg
)
except
smtplib
.
SMTPRecipientsRefused
,
inst
:
recipients
=
[
r
[
1
]
for
r
in
inst
.
recipients
.
values
()]
raise
util
.
Abort
(
'
\n
'
+
'
\n
'
.
join
(
recipients
))
except
smtplib
.
SMTPException
,
inst
:
raise
util
.
Abort
(
inst
)
def
validateconfig
(
ui
):
'''
determine if we have enough config data to try sending email.
'''
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment