C. Michael Pilato wrote:
> Daniel Widenfalk wrote:
>> Hi all,
>>
>> I've been struggling for the last couple of weeks with an issue
>> in the mailer.py script: the mailer kept sending me completely
>> empty commit-mails!
>
> We've not seen empty mails here in the Subversion project's own use of
> mailer.py, but we have been plagued by the occasional missing diff (instead
> displaying an error line about a non-existent tempfile) or -- even more
> confusingly -- weird diffs between two totally different files (presumably
> caused by the same tempfile mismanagement we see in the former case).
Ok. I made a quick fix to our mailer.py by making the script
ignore all matches that does not belong to a named group, i.e:
--- mailer.py.old 2007-09-25 17:15:57.000000000 +0200
+++ mailer.py 2008-09-05 17:21:20.000000000 +0200
@@ -352,16 +352,17 @@
self.groups = { }
for path, change in self.changelist:
for (group, params) in self.cfg.which_groups(path):
- # turn the params into a hashable object and stash it away
- param_list = params.items()
- param_list.sort()
- # collect the set of paths belonging to this group
- if self.groups.has_key( (group, tuple(param_list)) ):
- old_param, paths = self.groups[group, tuple(param_list)]
- else:
- paths = { }
- paths[path] = None
- self.groups[group, tuple(param_list)] = (params, paths)
+ if group is not None:
+ # turn the params into a hashable object and stash it away
+ param_list = params.items()
+ param_list.sort()
+ # collect the set of paths belonging to this group
+ if self.groups.has_key( (group, tuple(param_list)) ):
+ old_param, paths = self.groups[group, tuple(param_list)]
+ else:
+ paths = { }
+ paths[path] = None
+ self.groups[group, tuple(param_list)] = (params, paths)
# figure out the changed directories
dirs = { }
@@ -441,10 +442,11 @@
# collect the set of groups and the unique sets of params for the
options
self.groups = { }
for (group, params) in self.cfg.which_groups(''):
- # turn the params into a hashable object and stash it away
- param_list = params.items()
- param_list.sort()
- self.groups[group, tuple(param_list)] = params
+ if group is not None:
+ # turn the params into a hashable object and stash it away
+ param_list = params.items()
+ param_list.sort()
+ self.groups[group, tuple(param_list)] = params
self.output.subject = 'r%d - %s' % (repos.rev, propname)
@@ -532,16 +534,17 @@
self.groups = { }
for path in self.dirlist:
for (group, params) in self.cfg.which_groups(path):
- # turn the params into a hashable object and stash it away
- param_list = params.items()
- param_list.sort()
- # collect the set of paths belonging to this group
- if self.groups.has_key( (group, tuple(param_list)) ):
- old_param, paths = self.groups[group, tuple(param_list)]
- else:
- paths = { }
- paths[path] = None
- self.groups[group, tuple(param_list)] = (params, paths)
+ if group is not None:
+ # turn the params into a hashable object and stash it away
+ param_list = params.items()
+ param_list.sort()
+ # collect the set of paths belonging to this group
+ if self.groups.has_key( (group, tuple(param_list)) ):
+ old_param, paths = self.groups[group, tuple(param_list)]
+ else:
+ paths = { }
+ paths[path] = None
+ self.groups[group, tuple(param_list)] = (params, paths)
commondir, dirlist = get_commondir(self.dirlist)
----------------------
I'm not sure if this change is too much of a blunt axe or the
proper thing to do.
It could be a good idea to delay opening the pipe to sendmail
until the entire message has been built in a string/list/file
and add an "except all" (??? is there an equivalent to catch(...)
in Python?) to get a proper diagnostic message into the mail.
/D
--------------------------------------------------------------
Daniel Widenfalk IAR Systems AB
Senior Development Engineer Box 23051 (Islandsgatan 2)
S-75023 Uppsala, SWEDEN
Phone: +46 (0)18 167800 WWW: http://www.iar.se
Fax : +46 (0)18 167838 EMail: Daniel.Widenfalk_at_IAR.se
--------------------------------------------------------------
Legal note:
"The information contained in this message is confidential
and may be legally privileged. It is intended solely for
the addressee. Access to this message by anyone else is
unauthorized. If you are not the intended recipient, any
disclosure, copying or distribution of this message, or
any action or omission taken by you in reliance on it, is
prohibited and may be unlawful. Please immediately contact
the sender if you have received this message in error."
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org
Received on 2008-09-08 14:56:17 CEST