Chromium Code Reviews| 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) { |