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

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: Comment addressed 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..de6fb8a69648daf54b92b1cd6940e3e0b0cfe1e5 100644
--- a/Tools/GardeningServer/scripts/svn-log.js
+++ b/Tools/GardeningServer/scripts/svn-log.js
@@ -38,19 +38,25 @@ function findUsingRegExp(string, regexp)
function findReviewer(message)
{
- var regexp = /R=(.+)/;
+ var regexp = /(?:^|\n)\s*(?:TB)?R=(.+)/;
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 = /(?:^|\n)\s*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;
« no previous file with comments | « Tools/GardeningServer/scripts/model_unittests.js ('k') | Tools/GardeningServer/scripts/svn-log_unittests.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698