List:Commits« Previous MessageNext Message »
From:Andrei Elkin Date:June 18 2008 12:22pm
Subject:bzr commit into mysql_plugins branch (aelkin:120) Bug#37473, Bug#2
View as plain text  
#At file:///home/andrei/.bazaar/plugins/mysql_plugins/

  120 Andrei Elkin	2008-06-18
      Bug #37473  	bzr commit mail can not find the taget bug page
      
      1. the bug id pattern is incorrect. E.g a pattern like 'bug 123' is  recognized;
      2. the target bug (the first one in the comments) got sorted down and
         a lower bug id was treated as the target e.g bug#2.
            
      Fixed with correcting the patterns to correspond bk's post-commit
      trigger convention. Particularly, X-Bug mail message header is set
      correctly to the target bug.  Bugs references in the comments order is
      preserved in the list of bug ids in the subject line.
modified:
  .bzr-mysql/default.conf
  emailer.py

per-file messages:
  emailer.py
    correcting the bug pattern, removing sorting, correcting X-Bug to be singular.
=== modified file '.bzr-mysql/default.conf'
--- a/.bzr-mysql/default.conf	2008-05-21 22:17:24 +0000
+++ b/.bzr-mysql/default.conf	2008-06-18 10:22:29 +0000
@@ -1,5 +1,4 @@
 [MYSQL]
 tree_location = bzr+ssh://bk-internal.mysql.com/home/bk/bazaar/mysql_plugins/
-post_commit_to = mtaylor@stripped, cmiller@stripped
-post_push_to = bzr@stripped
+post_commit_to = commits@stripped, aelkin@stripped
 tree_name = mysql_plugins

=== modified file 'emailer.py'
--- a/emailer.py	2008-06-12 20:03:06 +0000
+++ b/emailer.py	2008-06-18 10:22:29 +0000
@@ -133,16 +133,13 @@ class EmailSender(object):
     def search_for_bugs(self, commit_message):
         """ scan entire log output for mentions of bugs, worklogs """
 
-        self.bug_ids_found = list(set(re.findall(r"(?i)\bbug[#:=]? ?(\d+)",
+        self.bug_ids_found = list(set(re.findall(r"(?i)\bbug[ ]*#[ ]*(\d+)",
                                                  commit_message.encode("utf8"))))
-        self.worklog_ids_found = list(set(re.findall(r"(?i)\bwl[#:=]? ?(\d+)",
+        self.worklog_ids_found = list(set(re.findall(r"(?i)\bwl[ ]*#[ ]*(\d+)",
                                                      commit_message.encode("utf8"))))
-        self.blueprint_ids_found = list(set(re.findall(r"(?i)\bblueprint[#:=]? ?(\d+)",
+        self.blueprint_ids_found = list(set(re.findall(r"(?i)\bblueprint[ ]*#[ ]*(\d+)",
                                                        commit_message.encode("utf8"))))
 
-        self.bug_ids_found.sort()
-        self.worklog_ids_found.sort()
-        self.blueprint_ids_found.sort()
 
     def pre_message(self):
         # This had better be in the same encoding as the output.  :\
@@ -278,8 +275,7 @@ class EmailSender(object):
         project = self.project()
         if project is not None:
             the_headers.append(('X-Project',project))
-        for bug_id in self.bug_ids_found:
-            the_headers.append(('X-Bug',str(bug_id)))
+        the_headers.append(('X-Bug',str(self.bug_ids_found[0])))
         for wl_id in self.worklog_ids_found:
             the_headers.append(('X-Worklog',str(wl_id)))
         for blueprint_id in self.blueprint_ids_found:

Thread
bzr commit into mysql_plugins branch (aelkin:120) Bug#37473, Bug#2Andrei Elkin18 Jun