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

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

Issue 498523002: [Sheriff-o-matic] Use likely_revisions instead of first_failing/last_passing (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase + no sort Created 6 years, 3 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
« no previous file with comments | « no previous file | Tools/GardeningServer/model/ct-commit-list-mock.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <link rel="import" href="ct-commit-log.html"> 7 <link rel="import" href="ct-commit-log.html">
8 8
9 <script> 9 <script>
10 function CTCommitList(group, commits) { 10 function CTCommitList(commitLog, revisions) {
11 this.commitLog = commits; 11 this._initRevisions(revisions);
12 if (group.failures && group.failures.first()) { 12 this.update(commitLog);
13 this.firstFailing = group.failures.first().firstFailingRevisions;
14 this.lastPassing = group.failures.first().lastPassingRevisions;
15 }
16 this._updateRepositories();
17 } 13 }
18 14
19 CTCommitList.prototype._updateRepositories = function() { 15 CTCommitList.prototype.update = function(commitLog) {
20 this.repositories = []; 16 this.repositories = [];
21 if (!this.commitLog || !this.lastPassing || !this.firstFailing) 17 if (!commitLog)
22 return; 18 return;
23 19
24 var allRepositories = this.commitLog._repositories.names; 20 var allRepositories = commitLog._repositories.names;
25 for (var i = 0; i < allRepositories.length; i++) { 21 for (var i = 0; i < allRepositories.length; i++) {
26 var repository = allRepositories[i]; 22 var repository = allRepositories[i];
23 if (!this.revisions[repository])
24 continue;
27 25
28 var commits = this._commits(repository); 26 var commits = commitLog.range(repository, this.revisions[repository]);
29 if (!commits.length) 27 if (!commits.length)
30 continue; 28 continue;
31 29
32 this.repositories.push({ 30 this.repositories.push({
33 name: repository, 31 name: repository,
34 range: this._range(commits), 32 range: this._displayRange(commits, repository),
35 commits: commits, 33 commits: commits,
36 expanded: false 34 expanded: false
37 }); 35 });
38 } 36 }
39 }; 37 };
40 38
41 CTCommitList.prototype._commits = function(repository) { 39 CTCommitList.prototype._initRevisions = function(repoRevisions) {
42 var commits = []; 40 this.revisions = {};
43 41 repoRevisions.forEach(function(repoRevision) {
44 if (!this.firstFailing || !this.lastPassing) 42 var split = repoRevision.split(':');
45 return []; 43 var repo = split[0];
46 44 var revision = parseInt(split[1], 10);
47 var firstFailing = Number(this.firstFailing[repository]); 45 if (revision && repo) {
48 var lastPassing = Number(this.lastPassing[repository]); 46 if (!this.revisions[repo]) {
49 if (firstFailing == lastPassing) 47 this.revisions[repo] = [revision];
50 return commits; 48 } else {
51 49 this.revisions[repo].push(revision);
52 if (lastPassing > firstFailing) { 50 }
53 console.warn('Revision range is backwards, which is invalid:', lastPassing, firstFailing); 51 }
54 return commits; 52 }.bind(this));
55 }
56
57 return this.commitLog.range(repository, lastPassing + 1, firstFailing);
58 }; 53 };
59 54
60 CTCommitList.prototype._range = function(commits) { 55 CTCommitList.prototype._displayRange = function(commits) {
61 return commits.first().revision + " : " + commits.last().revision; 56 return commits.first().revision + " : " + commits.last().revision;
62 }; 57 };
63 58
64 </script> 59 </script>
OLDNEW
« no previous file with comments | « no previous file | Tools/GardeningServer/model/ct-commit-list-mock.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698