14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17
"""Allow sending an email after a new commit.
19
This plugin provides a 'post_commit' hook, which is used to send an email (like
20
to a developer mailing list) with the basic contents of the change.
22
See the README file for basic information on how to configure this plugin.
17
"""Sending emails upon commit with informatiopn about the commit.
19
To have bzr send an email you need to configure an address to send mail
20
to for that branch. To do this set the configuration option ``post_commit_to``
21
and the address to send the mail from is read from the configuration option
22
``post_commit_sender`` (if not supplied defaults to the email address reported
25
By default, the diff for the commit will be included in the email, if the
26
length is less than 1000 lines. This limit can be changed (for instance, to 0
27
to disable the feature) by setting the configuration option
28
'post_commit_difflimit' to the number of lines you wish it to be limited to.
30
If you are using a bzr release from before 0.15, you need to manually tell
31
bzr about the commit action, by setting
32
post_commit=bzrlib.plugins.email.post_commit in bazaar.conf or locations.conf.
34
The URL of the branch is determined from the following checks (in order):
35
- If the configuration value 'post_commit_url' is set, it is used.
36
- If the configuration value 'public_branch' is set, it is used.
37
- The URL of the branch itself.
39
Setting public_branch is highly recommended if you commit via a protocol which
40
has a pricate address (e.g. bzr+ssh but anonymous access might be bzr:// or
43
How emails are sent is determined by the value of the configuration option
45
- Unset: use ``/usr/bin/mail``.
46
- ``smtplib``: Use python's smtplib to send the mail. If you use 'smtplib' you
47
can also configure the settings "smtp_server=host[:port]",
48
"smtp_username=userid", "smtp_password". If "smtp_username" is set but
49
"smtp_password" is not, you will be prompted for a password.S
51
Also, if using 'smtplib', the messages will be sent as a UTF-8 text message,
52
with a 8-bit text diff attached (rather than all-as-one). Work has also been
53
done to make sure usernames do not have to be ascii.
54
- Any other value: Run the value expecting it to behave like ``/usr/bin/mail``
55
- in particular supporting the -s and -a options.