Standardize the usage of "branch" vs. "branchName". https://bugs.webkit.org/show_bug...
authorjmarcell@apple.com <jmarcell@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Jan 2016 22:33:02 +0000 (22:33 +0000)
committerjmarcell@apple.com <jmarcell@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Jan 2016 22:33:02 +0000 (22:33 +0000)
Reviewed by Daniel Bates.

In an earlier patch we started using the name "branch" to indicate a branch object, whereas
"branchName" implies that the variable or property in question is simply a string.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js:
(BuildbotQueueView.prototype._popoverLinesForCommitRange): Change branch to branchName.
(BuildbotQueueView.prototype._presentPopoverForRevisionRange): Change branch to branch.name.
(BuildbotQueueView.prototype._revisionContentWithPopoverForIteration): Change branch to branchName.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Trac.js:
(Trac.prototype.commitsOnBranch): Change branch to branchName.
(Trac.prototype._convertCommitInfoElementToObject): Ditto.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/MockTrac.js:
(MockTrac): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@195076 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js
Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Trac.js
Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/MockTrac.js
Tools/ChangeLog

index 9267f49da7572d043d3b969b947df80925b17e38..248edabc2afedd49b7d7e13bbc415655a99fe250 100644 (file)
@@ -110,7 +110,7 @@ BuildbotQueueView.prototype = {
         new PopoverTracker(messageElement, this._presentPopoverForPendingCommits.bind(this), queue);
     },
 
-    _popoverLinesForCommitRange: function(trac, branch, firstRevisionNumber, lastRevisionNumber)
+    _popoverLinesForCommitRange: function(trac, branchName, firstRevisionNumber, lastRevisionNumber)
     {
         function lineForCommit(trac, commit)
         {
@@ -141,7 +141,7 @@ BuildbotQueueView.prototype = {
 
         // FIXME: To be 100% correct, we should also filter out changes that are ignored by
         // the queue, see _should_file_trigger_build in wkbuild.py.
-        var commits = trac.commitsOnBranch(branch, function(commit) { return commit.revisionNumber >= firstRevisionNumber && commit.revisionNumber <= lastRevisionNumber; });
+        var commits = trac.commitsOnBranch(branchName, function(commit) { return commit.revisionNumber >= firstRevisionNumber && commit.revisionNumber <= lastRevisionNumber; });
         return commits.map(function(commit) {
             return lineForCommit(trac, commit);
         }, this).reverse();
@@ -188,7 +188,7 @@ BuildbotQueueView.prototype = {
         content.className = "commit-history-popover";
 
         // FIXME: Nothing guarantees that Trac has historical data for these revisions.
-        var linesForCommits = this._popoverLinesForCommitRange(context.trac, context.branch, context.firstRevision, context.lastRevision);
+        var linesForCommits = this._popoverLinesForCommitRange(context.trac, context.branchName, context.firstRevision, context.lastRevision);
 
         var line = document.createElement("div");
         line.className = "title";
@@ -198,7 +198,7 @@ BuildbotQueueView.prototype = {
             content.appendChild(line);
             this._addDividerToPopover(content);
         } else {
-            line.textContent = "no commits to " + context.branch + " since previous result";
+            line.textContent = "no commits to " + context.branchName + " since previous result";
             content.appendChild(line);
         }
 
@@ -232,7 +232,7 @@ BuildbotQueueView.prototype = {
             console.assert(previousIteration.revision[repositoryName]);
             var context = {
                 trac: repository.trac,
-                branch: branch.name,
+                branchName: branch.name,
                 firstRevision: previousIteration.revision[repositoryName] + 1,
                 lastRevision: iteration.revision[repositoryName]
             };
index a1dd28fa2750ec2933cb8bfea8dc045c3a1526cb..2f0a4f2a1de4b6e53ea8fc48c57fe86c27249e92 100644 (file)
@@ -63,10 +63,10 @@ Trac.prototype = {
         return this.recordedCommits[this.recordedCommits.length - 1].revisionNumber;
     },
 
-    commitsOnBranch: function(branch, filter)
+    commitsOnBranch: function(branchName, filter)
     {
         return this.recordedCommits.filter(function(commit) {
-            return (!commit.containsBranchLocation || commit.branch === branch) && filter(commit);
+            return (!commit.containsBranchLocation || commit.branchName === branchName) && filter(commit);
         });
     },
 
@@ -149,11 +149,11 @@ Trac.prototype = {
             if (location.startsWith("tags/"))
                 result.tag = location.substr(5, location.indexOf("/", 5) - 5);
             else if (location.startsWith("branches/"))
-                result.branch = location.substr(9, location.indexOf("/", 9) - 9);
+                result.branchName = location.substr(9, location.indexOf("/", 9) - 9);
             else if (location.startsWith("releases/"))
                 result.release = location.substr(9, location.indexOf("/", 9) - 9);
             else if (location.startsWith("trunk/"))
-                result.branch = "trunk";
+                result.branchName = "trunk";
             else if (location.startsWith("submissions/"))
                 ; // These changes are never relevant to the dashboard.
             else {
index 1c6544109b183520a2b13bd8bb9dac176f71e041..d0515e071d03af762853b9212e55047c9a0dc1a1 100644 (file)
@@ -35,7 +35,7 @@ MockTrac = function()
             "date": "2015-11-15T17:05:44.000Z",
             "description": "description",
             "containsBranchLocation": true,
-            "branch": "trunk"
+            "branchName": "trunk"
         },
         {
             "revisionNumber": 33019,
@@ -45,7 +45,7 @@ MockTrac = function()
             "date": "2015-11-16T01:18:23.000Z",
             "description": "description",
             "containsBranchLocation": true,
-            "branch": "trunk"
+            "branchName": "trunk"
         },
         {
             "revisionNumber": 33020,
@@ -55,7 +55,7 @@ MockTrac = function()
             "date": "2015-11-16T01:19:27.000Z",
             "description": "description",
             "containsBranchLocation": true,
-            "branch": "trunk"
+            "branchName": "trunk"
         },
         {
             "revisionNumber": 33021,
@@ -65,7 +65,7 @@ MockTrac = function()
             "date": "2015-11-16T01:20:58.000Z",
             "description": "description",
             "containsBranchLocation": true,
-            "branch": "someOtherBranch"
+            "branchName": "someOtherBranch"
         },
         {
             "revisionNumber": 33022,
@@ -75,7 +75,7 @@ MockTrac = function()
             "date": "2015-11-16T01:22:01.000Z",
             "description": "description",
             "containsBranchLocation": true,
-            "branch": "trunk"
+            "branchName": "trunk"
         }
     ];
 };
index c1161a89e54dd39985d0a00f4ee2178ee2bd905e..249aaf98a46846038159a84935907d01a2ba9426 100644 (file)
@@ -1,3 +1,23 @@
+2016-01-14  Jason Marcell  <jmarcell@apple.com>
+
+        Standardize the usage of "branch" vs. "branchName".
+        https://bugs.webkit.org/show_bug.cgi?id=152982
+
+        Reviewed by Daniel Bates.
+
+        In an earlier patch we started using the name "branch" to indicate a branch object, whereas
+        "branchName" implies that the variable or property in question is simply a string.
+
+        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js:
+        (BuildbotQueueView.prototype._popoverLinesForCommitRange): Change branch to branchName.
+        (BuildbotQueueView.prototype._presentPopoverForRevisionRange): Change branch to branch.name.
+        (BuildbotQueueView.prototype._revisionContentWithPopoverForIteration): Change branch to branchName.
+        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Trac.js:
+        (Trac.prototype.commitsOnBranch): Change branch to branchName.
+        (Trac.prototype._convertCommitInfoElementToObject): Ditto.
+        * BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/tests/MockTrac.js:
+        (MockTrac): Ditto.
+
 2016-01-14  Jason Marcell  <jmarcell@apple.com>
 
         Add a unit test to test BuildbotQueueView._appendPendingRevisionCount.