[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] mailer.py to use revision author for from_addr

From: Blair Zajac <blair_at_orcaware.com>
Date: 2003-04-09 05:13:54 CEST

Can somebody with some Python fu check this? This sets the from address
to the revision author if no from_addr is set or it is set like this
from_addr =

I'm not certain about the == None and == "" tests.

Blair

Index: mailer.py
===================================================================
--- mailer.py (revision 5592)
+++ mailer.py (working copy)
@@ -157,6 +157,10 @@
   def start(self, group, params):
     self.to_addr = self.cfg.get('to_addr', group, params)
     self.from_addr = self.cfg.get('from_addr', group, params)
+ if self.from_addr == None or self.from_addr == "":
+ self.from_addr = self.repos.author
+ if self.from_addr == None or self.from_addr == "":
+ self.from_addr = 'no_author'
     self.reply_to = self.cfg.get('reply_to', group, params)

   def mail_headers(self, group, params):
Index: mailer.conf.example
===================================================================
--- mailer.conf.example (revision 5592)
+++ mailer.conf.example (working copy)
@@ -131,7 +131,10 @@
 # The default prefix for the Subject: header
 subject_prefix =

-# The default From: and To: addresses for commit messages
+# The default From: and To: addresses for commit messages. If the
+# from_addr is not set at all or there is no text following the =,
+# then the revision's author is used as the from address. If the
+# author is not specified, then 'no_author' is used.
 from_addr = invalid@example.com
 to_addr = invalid@example.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Apr 9 05:14:41 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.