[repo-management] hooks

Ben Cooksley bcooksley at kde.org
Mon Jan 24 02:24:02 GMT 2011


Git commit 56d644f3f56003986a86a9a17afcc4b3e008a913 by Ben Cooksley.
Pushed by bcooksley into branch 'master'.

Add message to email subject as requested. Common file path has been retained.
CCMAIL: kde-core-devel at kde.org

M  +4    -3    hooks/hooklib.py     

http://commits.kde.org/repomgmt/56d644f3f56003986a86a9a17afcc4b3e008a913

diff --git a/hooks/hooklib.py b/hooks/hooklib.py
index df01e91..025206c 100644
--- a/hooks/hooklib.py
+++ b/hooks/hooklib.py
@@ -568,7 +568,8 @@ class EmailNotifier(object):
         repo_path = self.repository.path
         if self.repository.ref_name != "master":
             repo_path += "/" + self.repository.ref_name
-        subject = "[{0}] {1}".format(repo_path, lowest_common_path)
+        short_msg = commit.message.splitlines()[0]
+        subject = unicode("[{0}] {1}: {2}").format(repo_path, lowest_common_path, short_msg)
 
         # Build up the body of the message...
         firstline = unicode("Git commit {0} by {1}.").format( commit.sha1,
@@ -603,7 +604,7 @@ class EmailNotifier(object):
 
         # Handle the normal mailing list mails....
         message = MIMEText( body.encode("utf-8"), 'plain', 'utf-8' )
-        message['Subject'] = Header( subject )
+        message['Subject'] = Header( subject.encode("utf-8"), 'utf-8', 76, 'Subject' )
         message['From']    = unicode("{0} <{1}>").format(
                 from_name, commit.committer_email )
         message['To']      = Header( self.notification_address )
@@ -631,7 +632,7 @@ class EmailNotifier(object):
 
             body = unicode('\n', "utf-8").join( bug_body )
             message = MIMEText( body.encode("utf-8"), 'plain' )
-            message['Subject'] = Header( subject )
+            message['Subject'] = Header( subject.encode("utf-8"), 'utf-8', 76, 'Subject' )
             message['From']    = unicode("{0} <{1}>").format(
                 from_name, commit.committer_email )
             message['To']      = Header( "bug-control at bugs.kde.org" )




More information about the kde-core-devel mailing list