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

Side by Side Diff: Tools/GardeningServer/model/ct-commit.html

Issue 402603007: Get sheriff-o-matic data from auto-sheriff.appspot.com. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: update and delete old code Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <!-- 1 <!--
2 Copyright 2014 The Chromium Authors. All rights reserved. 2 Copyright 2014 The Chromium Authors. All rights reserved.
3 Use of this source code is governed by a BSD-style license that can be 3 Use of this source code is governed by a BSD-style license that can be
4 found in the LICENSE file. 4 found in the LICENSE file.
5 --> 5 -->
6 6
7 <script> 7 <script>
8 function CTCommit(author, message) { 8 function CTCommit(author, message, baseUrl) {
ojan 2014/07/21 00:44:56 I can split these changes out to a different patch
9 this.author = author; 9 this.author = author;
10 this.message = message.trim(); 10 this.message = message.trim();
11 this.revision = this._findRevision(); 11 this.revision = this._findRevision();
12 this.summary = this.message.split('\n')[0]; 12 this.summary = this.message.split('\n')[0];
13 this._baseUrl = baseUrl;
14 }
15
16 CTCommit.prototype.url = function() {
abarth-chromium 2014/07/21 06:44:17 Getter?
ojan 2014/07/21 22:46:13 I really dislike getters. They make for surprising
17 var queryParameters = {
18 view: 'rev',
19 revision: this.revision,
20 };
21 return this._baseUrl + '?' + CTCommit._queryParam(queryParameters);
22 }
23
24 // FIXME: This should live somewhere better so it can be reused.
25 CTCommit._queryParam = function(params) {
abarth-chromium 2014/07/21 06:44:17 Object.toQueryString from sugar
ojan 2014/07/21 22:46:13 Not sure how I missed that.
26 var result = []
27 Object.keys(params, function(key, value) {
28 result.push(encodeURIComponent(key) + '=' + encodeURIComponent(value));
29 });
30 return result.join('&');
13 } 31 }
14 32
15 CTCommit.prototype._findRevision = function(message) { 33 CTCommit.prototype._findRevision = function(message) {
16 var regexp = /git-svn-id: svn:\/\/svn.chromium.org\/blink\/trunk@(\d+)/; 34 var regexp = /git-svn-id: svn:\/\/svn.chromium.org\/blink\/trunk@(\d+)/;
17 var match = regexp.exec(this.message); 35 var match = regexp.exec(this.message);
18 if (match) 36 if (match)
19 return parseInt(match[1], 10); 37 return parseInt(match[1], 10);
20 return null; 38 return null;
21 } 39 }
22 </script> 40 </script>
OLDNEW
« no previous file with comments | « no previous file | Tools/GardeningServer/model/ct-commit-log.html » ('j') | Tools/GardeningServer/ui/ct-builder-grid.html » ('J')

Powered by Google App Engine
This is Rietveld 408576698