Bug 829389 - Strip reviewers from *first line* of multiline commit messages. r=sfink
authorL. David Baron <dbaron@dbaron.org>
Tue, 27 Aug 2013 11:35:44 -0700
changeset 121 979d18af5993
parent 120 07b4ca7edd34
child 122 686ded533ba1
push id55
push userdbaron@mozilla.com
push date2013-08-27 18:36 +0000
reviewerssfink
bugs829389
Bug 829389 - Strip reviewers from *first line* of multiline commit messages. r=sfink
__init__.py
--- a/__init__.py
+++ b/__init__.py
@@ -707,33 +707,33 @@ def bzexport(ui, repo, *args, **opts):
                 bug = bzexport.newbug
 
         # Next strip any remaining leading separator with whitespace,
         # if the original was something like "bug NNN - "
         desc = desc.lstrip()
         if desc[0] in ['-', ':', '.']:
             desc = desc[1:].lstrip()
 
+        # Next, just take the first line in case. If there is more than one
+        # line, use it as a comment.
+        m = re.match(r'([^\n]*)\n+(.*)', desc, re.DOTALL)
+        if m:
+            desc = m.group(1)
+            patch_comment = m.group(2)
+
         # Next strip off review and approval annotations, grabbing the
         # reviewers from the patch comments only if -r auto was given
         def grab_reviewer(m):
             if opts['review'] == 'auto':
                 reviewers.append(m.group(1))
             return ''
         desc = review_re.sub(grab_reviewer, desc).rstrip()
         if len(reviewers) > 0:
             opts['review'] = ''
 
-        # Finally, just take the first line in case. If there is more than one
-        # line, use it as a comment.
-        m = re.match(r'([^\n]*)\n+(.*)', desc, re.DOTALL)
-        if m:
-            desc = m.group(1)
-            patch_comment = m.group(2)
-
     attachment_comment = opts['comment']
     bug_comment = opts['bug_description']
 
     if not attachment_comment:
         # New bugs get first shot at the patch comment
         if not opts['new'] or bug_comment:
             attachment_comment = patch_comment