Checkout Tools
  • last updated 6 hours ago
Constraints: committers
Constraints: files
Constraints: dates

Changeset 1869378 is being indexed. Handle otherwise uncaught exception in SMTPOutput.finish

Follow-up on r1869194. That revision addresses issue SVN-1804 by

adding exception handling for SMTP errors, but does not handle a

potential source of exceptions when closing a SMTP session.

* tools/hook-scripts/mailer/

(SMTPOutput.finish): Handle exception that may be raised by


Found by: futatuki

Review by: futatuki

Fix issue #1804: In, any SMTP error impedes later emails

Per SVN-1804, any SMTP error terminates with an unhandled

exception. The impact is that if the same invocation of

would have sent more emails, those that would have been sent after

the exception are silently lost.

To fix this issue, we handle SMTP exceptions. When an exception only

affects a particular email, such as invalid recipient, the error is

reported to stderr and execution continues to avoid losing any later

emails. In contrast, fatal SMTP errors, such as login with bad

credentials, terminate execution as before, but with some additional

reporting to stderr.

The script's exit code is zero if all emails were sent successfully,

nonzero if any SMTP error occurred.

* tools/hook-scripts/mailer/

(MessageSendFailure): New exception class to signify non-fatal

message sending failure. This is decoupled from SMTP to allow for

future use with other (non-SMTP) delivery methods.

(SMTPOutput.finish): Reimplement with exception handling and

reporting to stderr.

(Commit.generate, PropChange.generate, Lock.generate): Wrap contents

of for-loop in try..except block to handle new MessageSendFailure;

after the loop runs to completion, return nonzero if SMTP error(s)


(main): Propagate return value of messenger.generate() to caller.

(__main__): Exit nonzero if SMTP error(s) occurred.

Found by: Robert M. Zigweid

Review by: danielsh (partial review)


* tools/hook-scripts/mailer/ When 'import' fails, print the

exception's error message.

Discussed with: kfogel

(on dev@, thread "[PATCH] Better error message for svn bindings import in")

Give correct error message on failure to import Subversion Python bindings.

* tools/hook-scripts/mailer/ If the Subversion Python bindings

could not be found for import at all, have the error message state

that clearly, instead of duplicating the error message used for

importing too old a version of the bindings.

Reviewed by: cmpilato

Kenneth Porter


From: Karl Fogel

To: dev@

Subject: [PATCH] Better error message for svn bindings import in

Date: Mon, 12 Feb 2018 15:04:38 -0600

Message-ID: <>

Allow configuring to use SMTP SSL, using a new 'smtp_ssl' option

in the [general] section of mailer.conf.

Discussed in users@ thread "post-commit hook" around 2016-12-22, archived at

e.g. and in dev@ thread

"[PATCH] add SMTP SSL capability to mailer" started on 2016-12-22, archived

at e.g.

* tools/hook-scripts/mailer/mailer.conf.example

(general): Add an example of the new option.

* tools/hook-scripts/mailer/

(SMTPOutput): Use smtplib.SMTP_SSL instead of smtplib.SMTP if the option

is set.

Patch by: João M. S. Silva <joao.m.santos.silva{_AT_}>

Tweaked by me.

Following up on r1659509, extend the whitespace cleanup script to include

.sql and .sh files

* tools/dev/

Update script.


* subversion/libsvn_wc/wc-metadata.sql

* subversion/libsvn_wc/wc-queries.sql

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* tools/buildbot/slaves/i686-debian-sarge1/

* tools/buildbot/slaves/svn-x64-centos/

* tools/buildbot/slaves/svn-x64-centos/

* tools/buildbot/slaves/svn-x64-macosx-gnu-shared/

* tools/buildbot/slaves/svn-x64-macosx-gnu-shared-daily-ra_serf/

* tools/buildbot/slaves/ubuntu-x64/

* tools/client-side/

* tools/dev/benchmarks/large_dirs/

* tools/dist/

* tools/dist/

* tools/hook-scripts/mailer/tests/

* tools/po/

Apply whitespace cleanup.

  1. … 18 more files in changeset.
Apply the standard pre-branch whitespace cleanup via


There should be no functional changes.


* build/generator/

* build/generator/

* subversion/bindings/javahl/native/EditorProxy.h

* subversion/bindings/javahl/native/StateReporter.cpp

* subversion/bindings/javahl/native/org_apache_subversion_javahl_util_ConfigImpl_Category.cpp

* subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c

* subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.h

* subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c

* subversion/bindings/swig/ruby/libsvn_swig_ruby/swigutil_rb.c

* subversion/bindings/swig/ruby/test/test_fs.rb

* subversion/bindings/swig/ruby/test/util.rb

* subversion/bindings/swig/ruby/test/windows_util.rb

* subversion/include/private/svn_fs_fs_private.h

* subversion/include/private/svn_packed_data.h

* subversion/include/private/svn_repos_private.h

* subversion/include/private/svn_sorts_private.h

* subversion/include/private/svn_subr_private.h

* subversion/include/private/svn_wc_private.h

* subversion/include/svn_auth.h

* subversion/include/svn_cache_config.h

* subversion/include/svn_client.h

* subversion/include/svn_cmdline.h

* subversion/include/svn_diff.h

* subversion/include/svn_fs.h

* subversion/include/svn_io.h

* subversion/include/svn_ra.h

* subversion/include/svn_repos.h

* subversion/include/svn_string.h

* subversion/libsvn_client/blame.c

* subversion/libsvn_client/commit.c

* subversion/libsvn_client/commit_util.c

* subversion/libsvn_client/copy.c

* subversion/libsvn_client/diff.c

* subversion/libsvn_client/externals.c

* subversion/libsvn_client/log.c

* subversion/libsvn_client/patch.c

* subversion/libsvn_client/ra.c

* subversion/libsvn_client/update.c

* subversion/libsvn_delta/svndiff.c

* subversion/libsvn_diff/parse-diff.c

* subversion/libsvn_fs/fs-loader.c

* subversion/libsvn_fs_base/lock.c

* subversion/libsvn_fs_fs/cached_data.c

* subversion/libsvn_fs_fs/fs_fs.c

* subversion/libsvn_fs_fs/hotcopy.c

* subversion/libsvn_fs_fs/id.c

* subversion/libsvn_fs_fs/index.c

* subversion/libsvn_fs_fs/index.h

* subversion/libsvn_fs_fs/lock.c

* subversion/libsvn_fs_fs/low_level.c

* subversion/libsvn_fs_fs/low_level.h

* subversion/libsvn_fs_fs/pack.c

* subversion/libsvn_fs_fs/recovery.c

* subversion/libsvn_fs_fs/rev_file.c

* subversion/libsvn_fs_fs/revprops.c

* subversion/libsvn_fs_fs/revprops.h

* subversion/libsvn_fs_fs/stats.c

* subversion/libsvn_fs_fs/transaction.c

* subversion/libsvn_fs_fs/tree.c

* subversion/libsvn_fs_fs/verify.c

* subversion/libsvn_fs_x/cached_data.c

* subversion/libsvn_fs_x/changes.c

* subversion/libsvn_fs_x/dag.h

* subversion/libsvn_fs_x/fs.h

* subversion/libsvn_fs_x/fs_id.c

* subversion/libsvn_fs_x/fs_x.c

* subversion/libsvn_fs_x/hotcopy.c

* subversion/libsvn_fs_x/hotcopy.h

* subversion/libsvn_fs_x/index.c

* subversion/libsvn_fs_x/index.h

* subversion/libsvn_fs_x/lock.c

* subversion/libsvn_fs_x/lock.h

* subversion/libsvn_fs_x/low_level.c

* subversion/libsvn_fs_x/low_level.h

* subversion/libsvn_fs_x/noderevs.c

* subversion/libsvn_fs_x/pack.c

* subversion/libsvn_fs_x/reps.c

* subversion/libsvn_fs_x/rev_file.c

* subversion/libsvn_fs_x/revprops.c

* subversion/libsvn_fs_x/revprops.h

* subversion/libsvn_fs_x/string_table.c

* subversion/libsvn_fs_x/string_table.h

* subversion/libsvn_fs_x/transaction.c

* subversion/libsvn_fs_x/tree.c

* subversion/libsvn_fs_x/util.c

* subversion/libsvn_fs_x/verify.c

* subversion/libsvn_ra_local/ra_plugin.c

* subversion/libsvn_ra_serf/ra_serf.h

* subversion/libsvn_ra_serf/serf.c

* subversion/libsvn_ra_serf/update.c

* subversion/libsvn_ra_serf/util.c

* subversion/libsvn_ra_svn/client.c

* subversion/libsvn_ra_svn/marshal.c

* subversion/libsvn_repos/authz_pool.c

* subversion/libsvn_repos/config_pool.c

* subversion/libsvn_repos/dump.c

* subversion/libsvn_repos/fs-wrap.c

* subversion/libsvn_repos/log.c

* subversion/libsvn_subr/bit_array.c

* subversion/libsvn_subr/cache-membuffer.c

* subversion/libsvn_subr/config.c

* subversion/libsvn_subr/dirent_uri.c

* subversion/libsvn_subr/fnv1a.c

* subversion/libsvn_subr/gpg_agent.c

* subversion/libsvn_subr/hash.c

* subversion/libsvn_subr/io.c

* subversion/libsvn_subr/object_pool.c

* subversion/libsvn_subr/packed_data.c

* subversion/libsvn_subr/prefix_string.c

* subversion/libsvn_subr/sorts.c

* subversion/libsvn_subr/sqlite.c

* subversion/libsvn_subr/subst.c

* subversion/libsvn_subr/sysinfo.c

* subversion/libsvn_subr/types.c

* subversion/libsvn_subr/utf.c

* subversion/libsvn_subr/utf8proc/utf8proc_data.c

* subversion/libsvn_subr/x509info.c

* subversion/libsvn_wc/diff.h

* subversion/libsvn_wc/props.c

* subversion/libsvn_wc/update_editor.c

* subversion/libsvn_wc/wc.h

* subversion/libsvn_wc/wc_db.c

* subversion/libsvn_wc/wc_db.h

* subversion/mod_dav_svn/lock.c

* subversion/mod_dav_svn/mod_dav_svn.c

* subversion/mod_dav_svn/status.c

* subversion/svn/auth-cmd.c

* subversion/svn/info-cmd.c

* subversion/svn/mergeinfo-cmd.c

* subversion/svn/notify.c

* subversion/svn/propget-cmd.c

* subversion/svn/svn.c

* subversion/svnadmin/svnadmin.c

* subversion/svnserve/logger.c

* subversion/svnserve/serve.c

* subversion/svnserve/server.h

* subversion/svnserve/svnserve.c

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/libsvn_client/client-test.c

* subversion/tests/libsvn_client/mtcc-test.c

* subversion/tests/libsvn_fs/fs-test.c

* subversion/tests/libsvn_fs/locks-test.c

* subversion/tests/libsvn_fs_fs/fs-fs-fuzzy-test.c

* subversion/tests/libsvn_fs_fs/fs-fs-pack-test.c

* subversion/tests/libsvn_fs_x/fs-x-pack-test.c

* subversion/tests/libsvn_fs_x/string-table-test.c

* subversion/tests/libsvn_ra/ra-test.c

* subversion/tests/libsvn_subr/cache-test.c

* subversion/tests/libsvn_subr/checksum-test.c

* subversion/tests/libsvn_subr/config-test.c

* subversion/tests/libsvn_subr/io-test.c

* subversion/tests/libsvn_subr/packed-data-test.c

* subversion/tests/libsvn_subr/priority-queue-test.c

* subversion/tests/libsvn_subr/sqlite-test.c

* subversion/tests/libsvn_subr/string-test.c

* subversion/tests/libsvn_subr/subst_translate-test.c

* subversion/tests/libsvn_subr/x509-test.c

* subversion/tests/libsvn_wc/op-depth-test.c

* subversion/tests/svn_test_main.c

* tools/dev/benchmarks/RepoPerf/

* tools/dev/benchmarks/RepoPerf/

* tools/dev/

* tools/dev/fsfs-access-map.c

* tools/dev/

* tools/dev/x509-parser.c

* tools/diff/diff.c

* tools/dist/

* tools/dist/

* tools/hook-scripts/mailer/

* tools/server-side/svnpubsub/


Remove unneeded whitespace via script.

  1. … 184 more files in changeset.
Remove bashism in test suite

* mailer/tests/

Change echo -e to more portable printf

Patch by: Oleksandr Chumachenko <>

Approved by: philip

Fix an old header encoding buglet in

* tools/hook-scripts/mailer/

(MailedOutput._rfc2047_encode): New function.

(MailedOutput.mail_headers): Use _rfc2047_encode() to properly

encode the From:, To:, and Subject: headers

Patch by: Igor Galić <i.galic{_AT_}>

(Scope expanded by me.)

* **/**

Run tools/dev/ to remove all trailing whitespace

before we branch 1.8, like we did before creating previous branches.

No functional changes.

  1. … 199 more files in changeset.
Add a Date header and a Message-ID header to the mail generated by

* tools/hook-scripts/mailer/

(MailedOutput.mail_headers): Add a Date and Message-Id header to the output.

Patch by: Nick Peelman <nick{_AT_}>

(Tweaked by me to remove revision from Message-ID)

Fix problems with the test suite and fix not showing

directories with property deletions as being modified.

When using svn.repos.replay() property deletions don't show up in the

returned changelist from editor.get_changes().items() since the

changed_dir_prop function on the delta editor never gets called. This

could be a bug in the Python bindings or our C code. Setting send_deltas

to true and calling svn.repos.replay2() resolves the problem.

Some of the failures were simply that the group output is in a different

order than it was in the file. I suspect that the order of output from is not determinate, so long term this test setup will likely

have to be rewritten.

* mailer/

(Commit.__init__): Switch to using svn.repos.replay2() and pass 1 for


* mailer/tests/

Use --force when setting the svn:new_svn_prop since we reject properties

starting with svn: when we don't know about them. Set the mime-type

when adding a binary file since we only check for binary files by the


* mailer/tests/mailer-t1.output

Reorder some of the output to match the generated output (at least for me)

Follow-up to r1439592:

* tools/hook-scripts/mailer/

(main): Fix a copy-paste error in r1439592.

Patch by: Nick Peelman <> provide a "repos_dir basename" substitution variable.

Patch by: Janos Gyerik <>

(log message by me)

Review by: breser



* tools/hook-scripts/mailer/

(main): Define 'repos_basename' for substitution.

* tools/hook-scripts/mailer/mailer.conf.example

(SUBSTITUTIONS): Document "%(repos_basename)s".

Add license headers where possible, or exclude the file in rat-excludes.

* build/config.guess : Added to rat-excludes

* build/config.sub : Added to rat-excludes

* subversion/bindings/swig/python/tests/trac/versioncontrol/ :

Added to rat-excludes

* subversion/tests/cmdline/ : Added a License

* subversion/tests/cmdline/svntest/ Added to rat-excludes

* subversion/tests/manual/ : Added a License

* tools/buildbot/master/public_html/buildbot.css : Added to rat-excludes

* tools/client-side/ : Added a License

* tools/dev/iz/defect.dem : Added to rat-excludes

* tools/dev/iz/ff2csv.command : Added to rat-excludes

* tools/dev/unix-build/Makefile.svn : Added a License

* tools/dev/ : Added a License

* tools/dev/wc-ng/ : Added a License

* tools/dev/wc-ng/ : Added a License

* tools/dev/windows-build/Makefile : Added a License

* tools/dev/windows-build/ : Added a License

* tools/examples/svnlog2html.rb : Added a License

* tools/hook-scripts/commit-email.rb : Added a License

* tools/hook-scripts/mailer/tests/mailer-t1.output : Added to rat-excludes

* tools/hook-scripts/mailer/tests/mailer.conf : Added a License

Approved by: rhuijben

  1. … 12 more files in changeset.
Just padding my stats.

(Actually, doing my regular trailing whitespace removal, similar to r875968.)

* everywhere:

for extsn in c h cpp java py pl rb; do

sed -i -e 's/[ \t]*$//' `find . -name "*.$extsn" | xargs grep '[ \t]$' -l`


  1. … 166 more files in changeset.
If diff command fails then use difflib.unified_diff() to generate diff.

* tools/hook-scripts/mailer/

(DiffGenerator.__getitem__): Fall back to difflib.unified_diff()

if native 'diff' fails.

(_classify_diff_line): New function taken from DiffContent.__getitem__()

for reuse by the new class DifflibDiffContent.__getitem__().

(DifflibDiffContent): New diff generator using difflib.

Patch by: Noorul Islam K M <noorul{_AT_}>

Suggested by: me

Tweaked by: me (Refactored some duplicate code).

Move character-coding declaration lines in Python files back to the beginning

of the file where they need to be, after a licence message was inserted

before them in r882257. This fixes a failure to run the Python tests under

Python 2.5, which I noticed on the macosx buildbot.

* tools/hook-scripts/mailer/

* tools/hook-scripts/

* subversion/bindings/swig/python/tests/trac/

Move the "coding" line back to the beginning, just after the she-bang line.

  1. … 2 more files in changeset.
Extend "" with an option "search_logmsg=REGEXP" to allow filtering

based on matching expressions in the log message such as bug id's.

Patch by: Justin Vallon <justin.vallon{_AT_}>

* tools/hook-scripts/mailer/mailer.conf.example

Add documentation and an example of the new configuration options.

* tools/hook-scripts/mailer/

(Commit): Pass the log message to the which_groups() call.

(PropChange, Lock): Pass no log message to the which_groups() call.

(Config): Parse the new option and extend the which_groups() function

to include groups specified through matching the log message.

* tools/hook-scripts/mailer/tests/mailer.conf

(bugtracker): New section with the new configuration options.

* tools/hook-scripts/mailer/tests/

Put some example bug id's into some of the commit messages.

* tools/hook-scripts/mailer/tests/mailer-t1.output

Adjust for the additions and changes to the expected output.

Apply ASF license headers to a number of files included under that license

but lacking said header.

Patch by: Niall Pemberton <niallp{_AT_}>

  1. … 172 more files in changeset.
Add four X-* headers to generated emails to allow clients to

filter on them.

* tools/hook-scripts/mailer/


Add four headers:

X-Svn-Commit-Project: the matching group name

X-Svn-Commit-Author: the author

X-Svn-Commit-Revision: the revision

X-Svn-Commit-Repository: the basename of the repository

Patch by: J Robert Ray <>

Tweaked by: me

Use 'while True' instead of 'while 1'.

* build/generator/

* build/generator/

* subversion/bindings/swig/python/svn/

* subversion/bindings/swig/python/svn/

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/cmdline/svntest/

* tools/bdb/

* tools/dev/

* tools/dev/

* tools/dev/

* tools/dev/

* tools/dev/

* tools/examples/

* tools/examples/

* tools/examples/

* tools/examples/

* tools/hook-scripts/mailer/

* tools/hook-scripts/ Use 'while True' instead of 'while 1'.

  1. … 18 more files in changeset.
Python 3 compatibility:

Don't use deprecated members of types module.

* build/generator/

* subversion/bindings/swig/python/tests/

* subversion/bindings/swig/python/tests/

* subversion/tests/cmdline/svntest/

* tools/bdb/ Don't use deprecated members of types module.

* tools/hook-scripts/mailer/ Don't import types module.

  1. … 5 more files in changeset.
* build/generator/

(Generator.makeguid): Delete code used only by Python 1.*.

* subversion/bindings/ctypes-python/README


* subversion/bindings/swig/python/libsvn_swig_py/swigutil_py.c

(): Don't define Py_RETURN_NONE.

* subversion/tests/cmdline/

(match_xml_element): Directly compare dictionaries.

(same_dict): Delete.

* tools/client-side/ Delete probably outdated comment.

* tools/hook-scripts/mailer/ Delete code used only by Python <2.3.

  1. … 5 more files in changeset.
Use sorted() to simplify some code.

* build/generator/

* build/generator/

* build/generator/

* build/win32/

* doc/tools/bin/


* subversion/bindings/swig/python/tests/

* subversion/bindings/swig/python/tests/

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/cmdline/

* subversion/tests/cmdline/svntest/

* subversion/tests/cmdline/svntest/

* tools/bdb/

* tools/dev/

* tools/dev/

* tools/dev/

* tools/dev/

* tools/examples/

* tools/hook-scripts/mailer/

* tools/po/ Use sorted() to simplify some code.

  1. … 20 more files in changeset.
Delete code used only by Python <2.4.

* build/generator/util/

* subversion/bindings/swig/python/svn/

* subversion/tests/cmdline/svntest/

* subversion/tests/cmdline/

* tools/backup/

* tools/hook-scripts/mailer/

* tools/hook-scripts/ Delete code used only by Python <2.4.

  1. … 6 more files in changeset.
Follow-up to r34959:

* tools/hook-scripts/mailer/

( Try to use subprocess module.

Python 3 compatibility:

Don't assing values to True/False keywords.

* build/generator/

* build/generator/

* build/generator/

* subversion/bindings/swig/python/svn/

* subversion/tests/cmdline/svntest/

* tools/client-side/

* tools/dev/

* tools/hook-scripts/

* tools/hook-scripts/mailer/ Don't assing values to True/False keywords.

  1. … 8 more files in changeset.
Python 3 compatibility:

Try to use urllib.parse.* and urllib.request.* instead of urllib.* and urllib2.*.

* subversion/tests/cmdline/svntest/

* tools/dev/

* tools/dev/

* tools/dist/

* tools/hook-scripts/mailer/

* tools/server-side/

* tools/server-side/ Try to use urllib.parse.* and

urllib.request.* instead of urllib.* and urllib2.*.

  1. … 6 more files in changeset.
Python 3 compatibility:

Try to use subprocess module in 'tools' directory.

* tools/hook-scripts/mailer/

* tools/hook-scripts/ Try to use subprocess module.

* tools/backup/ Fix a typo.

  1. … 2 more files in changeset.