Bug 829389 - Strip reviewers from *first line* of multiline commit messages. r=sfink
--- 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