[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

abarth at webkit.org abarth at webkit.org
Wed Dec 22 13:27:23 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 057928221f075431dd7dd286d4e25fb5ebe106bd
Author: abarth at webkit.org <abarth at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Sep 16 01:19:25 2010 +0000

    2010-09-15  Adam Barth  <abarth at webkit.org>
    
            Reviewed by Eric Seidel.
    
            [reviewtool] Allow setting review and commit-queue flags from main review screen
            https://bugs.webkit.org/show_bug.cgi?id=45860
    
            This patch adds drop down menus for adjusting the review and
            commit-queue flags from the main review screen.  These controls don't
            appear immediately because we need to read the state of the flags off
            the details page.
    
            It's a slight sadness that bugzilla doesn't have a clean way of
            identifying which select control is associated with a given flag.  The
            flags seem to have some sort of id, but it's unclear to me how to map
            that id back to a notion of "review" or "commit-queue".  Instead, we
            look for some magic strings in the title.  I'm sure this will come back
            to bit us at some point, but I'm not sure what to do that's better.
            (The webkitpy solution to this problem is to assume that the flags are
            in a given order, but this seems better.)
    
            * PrettyPatch/PrettyPatch.rb:
                - Bump version number to bust throuh caches.
            * code-review.js:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67590 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/BugsSite/ChangeLog b/BugsSite/ChangeLog
index a580960..05bac07 100644
--- a/BugsSite/ChangeLog
+++ b/BugsSite/ChangeLog
@@ -2,6 +2,31 @@
 
         Reviewed by Eric Seidel.
 
+        [reviewtool] Allow setting review and commit-queue flags from main review screen
+        https://bugs.webkit.org/show_bug.cgi?id=45860
+
+        This patch adds drop down menus for adjusting the review and
+        commit-queue flags from the main review screen.  These controls don't
+        appear immediately because we need to read the state of the flags off
+        the details page.
+
+        It's a slight sadness that bugzilla doesn't have a clean way of
+        identifying which select control is associated with a given flag.  The
+        flags seem to have some sort of id, but it's unclear to me how to map
+        that id back to a notion of "review" or "commit-queue".  Instead, we
+        look for some magic strings in the title.  I'm sure this will come back
+        to bit us at some point, but I'm not sure what to do that's better.
+        (The webkitpy solution to this problem is to assume that the flags are
+        in a given order, but this seems better.)
+
+        * PrettyPatch/PrettyPatch.rb:
+            - Bump version number to bust throuh caches.
+        * code-review.js:
+
+2010-09-15  Adam Barth  <abarth at webkit.org>
+
+        Reviewed by Eric Seidel.
+
         [reviewtool] Comments should quote previous comments on the same line
         https://bugs.webkit.org/show_bug.cgi?id=45847
 
diff --git a/BugsSite/PrettyPatch/PrettyPatch.rb b/BugsSite/PrettyPatch/PrettyPatch.rb
index 360dc30..187701f 100644
--- a/BugsSite/PrettyPatch/PrettyPatch.rb
+++ b/BugsSite/PrettyPatch/PrettyPatch.rb
@@ -298,7 +298,7 @@ body {
 }
 </style>
 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> 
-<script src="code-review.js?version=7"></script> 
+<script src="code-review.js?version=8"></script> 
 EOF
 
     def self.revisionOrDescription(string)
diff --git a/BugsSite/code-review.js b/BugsSite/code-review.js
index ef41ebd..c37b09a 100644
--- a/BugsSite/code-review.js
+++ b/BugsSite/code-review.js
@@ -193,6 +193,33 @@
     return comments;
   }
 
+  function isReviewFlag(select) {
+    return $(select).attr('title') == 'Request for patch review.';
+  }
+
+  function isCommitQueueFlag(select) {
+    return $(select).attr('title').match(/commit-queue/);
+  }
+
+  function findControlForFlag(select) {
+    if (isReviewFlag(select))
+      return $('#toolbar .review select');
+    else if (isCommitQueueFlag(select))
+      return $('#toolbar .commitQueue select');
+    return $();
+  }
+
+  function addFlagsForAttachment(details) {
+    var flag_control = "<select><option></option><option>?</option><option>+</option><option>-</option></select>";
+    $('#toolbar .actions').append(
+      $('<span class="review"> r: ' + flag_control + '</span>')).append(
+      $('<span class="commitQueue"> cq: ' + flag_control + '</span>'));
+
+    details.find('#flags select').each(function() {
+      findControlForFlag(this).attr('selectedIndex', $(this).attr('selectedIndex'));
+    });
+  }
+
   function fetchHistory() {
     $.get('attachment.cgi?id=' + attachment_id + '&action=edit', function(data) {
       var bug_id = /Attachment \d+ Details for Bug (\d+)/.exec(data)[1];
@@ -207,6 +234,10 @@
         });
         displayPreviousComments(comments);
       });
+
+      var details = $(data);
+
+      addFlagsForAttachment(details);
     });
   }
 
@@ -221,8 +252,8 @@
   $(document).ready(function() {
     crawlDiff();
     fetchHistory();
-    $(document.body).prepend('<div id="toolbar"><div class="actions"><button id="post_comments">Publish comments</button></div><div class="message"><span class="commentStatus"></span> <span class="help">Double-click a line to add a comment.</span></div></div>');
-    $(document.body).prepend('<div id="comment_form" class="inactive"><div class="winter"></div><div class="lightbox"><iframe src="attachment.cgi?id=' + attachment_id + '&action=reviewform"></iframe></div></div>');
+    $(document.body).prepend('<div id="toolbar"><div class="actions"><button id="post_comments">Publish</button></div><div class="message"><span class="commentStatus"></span> <span class="help">Double-click a line to add a comment.</span></div></div>');
+    $(document.body).prepend('<div id="comment_form" class="inactive"><div class="winter"></div><div class="lightbox"><iframe id="reviewform" src="attachment.cgi?id=' + attachment_id + '&action=reviewform"></iframe></div></div>');
     $(document.body).append('<div class="overallComments"><div class="description">Overall comments:</div><textarea></textarea></div>');
   });
 
@@ -426,6 +457,13 @@
     comment += comments_in_context.join('\n\n');
     if (comment != '')
       comment = 'View in context: ' + window.location + '\n\n' + comment;
-    $('#comment_form').find('iframe').contents().find('#comment').val(comment);
+    var review_form = $('#reviewform').contents();
+    review_form.find('#comment').val(comment);
+    review_form.find('#flags select').each(function() {
+      var control = findControlForFlag(this);
+      if (!control.size())
+        return;
+      $(this).attr('selectedIndex', control.attr('selectedIndex'));
+    });
   });
 })();

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list