Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1875)

Unified Diff: Tools/GardeningServer/scripts/svn-log.js

Issue 177123013: Garden-o-matic: Display bugs from the commit BUG=... line in commit summary (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Tools/GardeningServer/scripts/svn-log.js
diff --git a/Tools/GardeningServer/scripts/svn-log.js b/Tools/GardeningServer/scripts/svn-log.js
index ac500c71e1ef758a0650e2648cb3666da1023127..19bad7022d5fce2b155207e7aeefd117d44db34d 100644
--- a/Tools/GardeningServer/scripts/svn-log.js
+++ b/Tools/GardeningServer/scripts/svn-log.js
@@ -42,15 +42,21 @@ function findReviewer(message)
var reviewers = findUsingRegExp(message, regexp);
if (!reviewers)
return null;
- return reviewers.replace(/\s*,\s*/, ", ");
+ return reviewers.replace(/\s*,\s*/, ', ');
}
function findBugID(message)
{
- var regexp = /BUG=(\d+)/;
- var bugID = parseInt(findUsingRegExp(message, regexp), 10);
- return isNaN(bugID) ? 0 : bugID;
-
+ var regexp = /BUG=(.+)/;
+ var value = findUsingRegExp(message, regexp);
+ if (!value)
+ return null;
+ return value.split(/\s*,\s*/).map(function(id) {
+ var parsedID = parseInt(id.replace(/[^\d]/g, ''), 10);
+ return isNaN(parsedID) ? 0 : parsedID;
+ }).filter(function(id) {
+ return !!id;
+ });
}
function findRevision(message)
@@ -62,7 +68,7 @@ function findRevision(message)
function parseCommitMessage(message) {
var lines = message.split('\n');
- var title = "";
+ var title = '';
lines.some(function(line) {
if (line) {
title = line;

Powered by Google App Engine
This is Rietveld 408576698