[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/548718
Reviewed-by: Marc-Antoine Ruel <maruel@chromium.org>
Commit-Queue: Nicolas Dossou-Gbété <dgn@chromium.org>
changes/18/548718/5
Nicolas Dossou-gbete 8 years ago committed by Commit Bot
parent 49b8147be0
commit 903ea73119

@ -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(','))

Loading…
Cancel
Save