<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><span class="vcard"><a class="email" href="mailto:dbates&#64;webkit.org" title="Daniel Bates &lt;dbates&#64;webkit.org&gt;"> <span class="fn">Daniel Bates</span></a>
</span> changed
              <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Refactor BuildbotQueueView._presentPopoverForPendingCommits to work more generically with repositories other than &quot;openSource&quot; and &quot;internal&quot;."
   href="https://bugs.webkit.org/show_bug.cgi?id=147961">bug 147961</a>
        <br>
             <table border="1" cellspacing="0" cellpadding="8">
          <tr>
            <th>What</th>
            <th>Removed</th>
            <th>Added</th>
          </tr>

         <tr>
           <td style="text-align:right;">Attachment #259046 Flags</td>
           <td>review?, commit-queue?
           </td>
           <td>review-, commit-queue-
           </td>
         </tr></table>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Refactor BuildbotQueueView._presentPopoverForPendingCommits to work more generically with repositories other than &quot;openSource&quot; and &quot;internal&quot;."
   href="https://bugs.webkit.org/show_bug.cgi?id=147961#c11">Comment # 11</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Refactor BuildbotQueueView._presentPopoverForPendingCommits to work more generically with repositories other than &quot;openSource&quot; and &quot;internal&quot;."
   href="https://bugs.webkit.org/show_bug.cgi?id=147961">bug 147961</a>
              from <span class="vcard"><a class="email" href="mailto:dbates&#64;webkit.org" title="Daniel Bates &lt;dbates&#64;webkit.org&gt;"> <span class="fn">Daniel Bates</span></a>
</span></b>
        <pre>Comment on <span class=""><a href="attachment.cgi?id=259046&amp;action=diff" name="attach_259046" title="Patch">attachment 259046</a> <a href="attachment.cgi?id=259046&amp;action=edit" title="Patch">[details]</a></span>
Patch

View in context: <a href="https://bugs.webkit.org/attachment.cgi?id=259046&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=259046&amp;action=review</a>

<span class="quote">&gt; Tools/BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotQueueView.js:177
&gt; +        var shouldAddDivider = false;
&gt; +        var sortedRepositories = Dashboard.sortedRepositories;
&gt; +        for (var i = 0; i &lt; sortedRepositories.length; i++) {
&gt; +            var repository = sortedRepositories[i];
&gt; +            var trac = repository.trac;
&gt; +            var repositoryName = repository.name;
&gt; +            var latestProductiveRevisionNumber = latestProductiveIteration.revision[repositoryName];
&gt; +            var lines = [];
&gt; +            if (latestProductiveRevisionNumber &amp;&amp; trac.latestRecordedRevisionNumber) {
&gt; +                if (shouldAddDivider) {
&gt; +                    this._addDividerToPopover(content);
&gt; +                    shouldAddDivider = false;
&gt; +                }
&gt; +
&gt; +                lines = this._popoverLinesForCommitRange(trac, queue.branch[repositoryName], latestProductiveRevisionNumber + 1, trac.latestRecordedRevisionNumber);
&gt; +                for (var i = 0; i != lines.length; ++i)
&gt; +                    content.appendChild(lines[i]);
&gt; +
&gt; +                if (lines.length)
&gt; +                    shouldAddDivider = true;
&gt; +            }
&gt; +        }</span >

This is not correct. Suppose there are three repositories A, B and when processing these repositories (in this order) lines.length = 1, 0, respectively. Then the output content will look like A_1, &quot;divider&quot;. But it should be A_1.

Maybe something like this will work:

var shouldAddDivider = false;
var sortedRepositories = Dashboard.sortedRepositories;
for (var i = 0; i &lt; sortedRepositories.length; ++i) {
    var repository = sortedRepositories[i];
    var trac = repository.trac;
    var repositoryName = repository.name;
    var latestProductiveRevisionNumber = latestProductiveIteration.revision[repositoryName];
    if (!latestProductiveRevisionNumber || !trac.latestRecordedRevisionNumber)
        continue;
    var lines = this._popoverLinesForCommitRange(trac, queue.branch[repositoryName], latestProductiveRevisionNumber + 1, trac.latestRecordedRevisionNumber);
    var length = lines.length;
    if (length &amp;&amp; shouldAddDivider)
        this._addDividerToPopover(content);
    for (var i = 0; i &lt; length; ++i)
        content.appendChild(lines[i]);
    shouldAddDivider = shouldAddDivider || length &gt; 0;
}</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>