Commit 903ea731 authored by Nicolas Dossou-gbete's avatar Nicolas Dossou-gbete Committed by Commit Bot

[activity.py] Identify Gerrit-style bug annotations in commit messages

Extract bug numbers noted "Bug: 99999" in addition to the older
"BUG=99999" style.

Bug: None
Change-Id: If29139ee2bae3c515748395a846e45ce6995d9ec
Reviewed-on: https://chromium-review.googlesource.com/548718Reviewed-by: 's avatarMarc-Antoine Ruel <maruel@chromium.org>
Commit-Queue: Nicolas Dossou-Gbété <dgn@chromium.org>
parent 49b8147b
......@@ -265,7 +265,10 @@ class MyActivity(object):
bugs = []
if description:
matches = re.findall('BUG=(((\d+)(,\s?)?)+)', description)
# Handle both "Bug: 99999" and "BUG=99999" bug notations
# Multiple bugs can be noted on a single line or in multiple ones.
matches = re.findall(r'BUG[=:]\s?(((\d+)(,\s?)?)+)', description,
flags=re.IGNORECASE)
if matches:
for match in matches:
bugs.extend(match[0].replace(' ', '').split(','))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment