3
Generate a changeset and send it by mail.
6
import bzrlib, bzrlib.changeset
9
from email import Encoders
10
from email.Message import Message
11
from email.MIMEBase import MIMEBase
12
from email.MIMEMultipart import MIMEMultipart
13
from email.MIMEText import MIMEText
16
def send_changeset(to_address, from_address, subject,
17
changeset_fp, message):
18
# Create the enclosing (outer) message
19
outer = MIMEMultipart()
20
outer['Subject'] = '[PATCH] ' + subject
21
outer['To'] = to_address
22
outer['From'] = from_address
25
msg = MIMEText(message)
28
msg = MIMEText(changeset_fp.read())
29
#msg.add_header('Content-Disposition', 'attachment', filename=')
35
s.sendmail(from_address, to_address, outer.as_string())