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

Unified Diff: Tools/GardeningServer/model/ct-commit-log.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, 4 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/model/ct-commit-log.html
diff --git a/Tools/GardeningServer/model/ct-commit-log.html b/Tools/GardeningServer/model/ct-commit-log.html
index 6bfa08dbe321a2003d56cc7d1720bb71a228eaba..d8078fea70dbab974a445fa12d13e25ccd120595 100644
--- a/Tools/GardeningServer/model/ct-commit-log.html
+++ b/Tools/GardeningServer/model/ct-commit-log.html
@@ -11,7 +11,6 @@ found in the LICENSE file.
<script>
function CTCommitLog() {
this.commits = {};
- this.firstRevision = {};
this.lastRevision = {};
this._repositories = new CTRepositories();
@@ -50,32 +49,27 @@ CTCommitLog.prototype._handleResponse = function(repositoryUrl, repository, json
}
}.bind(this));
- this._findFirstAndLastRevisions(repository);
+ this._updateLastRevision(repository);
}
-CTCommitLog.prototype._findFirstAndLastRevisions = function(repository) {
+CTCommitLog.prototype._updateLastRevision = function(repository) {
var sortedCommits = Object.keys(this.commits[repository]).sort();
- this.firstRevision[repository] = parseInt(sortedCommits.first());
- this.lastRevision[repository] = parseInt(sortedCommits.last());
+ this.lastRevision[repository] = sortedCommits.last();
}
-CTCommitLog.prototype.range = function(repository, first, last) {
+CTCommitLog.prototype.range = function(repository, revisions) {
var commits = [];
- for (var revision = first; revision <= last; revision++) {
- var commit = this.commits[repository][revision];
- if (!commit) {
- // FIXME: This is wrong. If we iterate through revisions and then later
- // in handleReponse we realize that this revision doesn't actually exist
- // in the repo (e.g. because it corresponds to a branch commit), then we
- // don't remove the incomplete commit.
- var url = this._repositories.repositories[repository].repositoryUrl;
- commit = CTCommit.createIncomplete(url, revision, repository);
- this.commits[repository][revision] = commit;
- }
+ revisions.forEach(function(revision) {
+ var commit = this.commits[repository][revision];
+ if (!commit) {
+ var url = this._repositories.repositories[repository].repositoryUrl;
+ var commit = CTCommit.createIncomplete(url, revision, repository);
+ this.commits[repository][revision] = commit;
+ }
- if (commit)
- commits.push(commit);
- }
+ if (commit)
+ commits.push(commit);
+ }.bind(this));
return commits;
}
</script>
« no previous file with comments | « Tools/GardeningServer/model/ct-commit-list-mock.html ('k') | Tools/GardeningServer/model/ct-commit-log-mock.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698