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

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: sort git hashes 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..ddfb4b100ea6aff1aee58ef8c1e710444ccf9164 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,33 @@ 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(repoRevision) {
+ if (repoRevision.lastIndexOf(repository, 0) !== 0)
ojan 2014/08/23 01:23:05 Use startsWith. http://sugarjs.com/api/String/star
Mathieu 2014/08/24 23:42:10 Done.
+ return;
- if (commit)
- commits.push(commit);
- }
+ // Extract the revision, since elements of |revisions| are of the form
+ // <repo>:<revisionId>.
+ var revision = repoRevision.substring(repository.length + 1);
+ 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);
+ }.bind(this));
return commits;
}
</script>

Powered by Google App Engine
This is Rietveld 408576698