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

Unified Diff: Tools/GardeningServer/model/ct-commit-log.html

Issue 410483002: Add the revision details widget to sheriff-o-matic (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update to ToT, add Popup Menu and tests. 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 eccb55f829c669f46eb94a39b0d3d0d813bb1466..9bd1a43cfe35bde6fb479b74b96fa88773786865 100644
--- a/Tools/GardeningServer/model/ct-commit-log.html
+++ b/Tools/GardeningServer/model/ct-commit-log.html
@@ -12,6 +12,7 @@ found in the LICENSE file.
function CTCommitLog() {
this.commits = {};
this.firstRevision = {};
+ this.lastRevision = {};
this._repositories = new CTRepositories();
}
@@ -36,7 +37,13 @@ CTCommitLog.prototype._handleResponse = function(repositoryUrl, repository, json
this.commits[repository][commit.revision] = commit;
}.bind(this));
- this.firstRevision[repository] = Object.keys(this.commits[repository]).sort()[0];
+ this._findFirstAndLastRevisions(repository);
+}
+
+CTCommitLog.prototype._findFirstAndLastRevisions = function(repository) {
+ var sortedCommits = Object.keys(this.commits[repository]).sort();
+ this.firstRevision[repository] = parseInt(sortedCommits[0]);
+ this.lastRevision[repository] = parseInt(sortedCommits[sortedCommits.length - 1]);
ojan 2014/08/05 02:07:23 sugarjs has first() and last() for these.
ojan 2014/08/05 02:07:23 sugarjs has first() and last() for these.
}
CTCommitLog.prototype.range = function(repository, first, last) {

Powered by Google App Engine
This is Rietveld 408576698