2011-01-20 Ojan Vafai <ojan@chromium.org>
authorojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Jan 2011 00:58:50 +0000 (00:58 +0000)
committerojan@chromium.org <ojan@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 Jan 2011 00:58:50 +0000 (00:58 +0000)
        Reviewed by Oliver Hunt.

        Could review tool include style failure info?
        https://bugs.webkit.org/show_bug.cgi?id=49049

        This does not handle patches that have old paths (e.g. without the Source prefix).
        Although that would be fairly straightforward to workaround.

        * code-review.js:

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

Websites/bugs.webkit.org/ChangeLog
Websites/bugs.webkit.org/PrettyPatch/PrettyPatch.rb
Websites/bugs.webkit.org/code-review.js

index 3e16960..ee88f28 100644 (file)
@@ -1,5 +1,17 @@
 2011-01-20  Ojan Vafai  <ojan@chromium.org>
 
+        Reviewed by Oliver Hunt.
+
+        Could review tool include style failure info?
+        https://bugs.webkit.org/show_bug.cgi?id=49049
+
+        This does not handle patches that have old paths (e.g. without the Source prefix).
+        Although that would be fairly straightforward to workaround.
+
+        * code-review.js:
+
+2011-01-20  Ojan Vafai  <ojan@chromium.org>
+
         Reviewed by Adam Barth.
 
         handle cases where PrettyPatch.rb doesn't linkify filenames
index 203f213..b103819 100644 (file)
@@ -417,7 +417,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=27"></script>
+<script src="code-review.js?version=28"></script>
 EOF
 
     def self.revisionOrDescription(string)
index ffa251d..45b4bc8 100644 (file)
     $('#message .commentStatus').text('This patch has ' + descriptor + '.  Scroll through them with the "n" and "p" keys. ' + help_text);
   }
 
+  function scanForStyleQueueComments(text) {
+    var comments = []
+    var lines = text.split('\n');
+    for (var i = 0; i < lines.length; ++i) {
+      var parts = lines[i].match(/^([^:]+):(-?\d+):(.*)$/);
+      if (!parts)
+        continue;
+
+      var file_name = parts[1];
+      var line_number = parts[2];
+      var comment_text = parts[3].trim();
+
+      if (!file_name in files) {
+        console.log('Filename in style queue output is not in the patch: ' + file_name);
+        continue;
+      }
+
+      comments.push({
+        'author': 'StyleQueue',
+        'file_name': file_name,
+        'line_number': line_number,
+        'comment_text': comment_text
+      });
+    }
+    return comments;
+  }
+
   function scanForComments(author, text) {
     var comments = []
     var lines = text.split('\n');
         $(data).find('.bz_comment').each(function() {
           var author = $(this).find('.email').text();
           var text = $(this).find('.bz_comment_text').text();
+
           var comment_marker = '(From update of attachment ' + attachment_id + ' .details.)';
           if (text.match(comment_marker))
             $.merge(comments, scanForComments(author, text));
+
+          var style_queue_comment_marker = 'Attachment ' + attachment_id + ' .details. did not pass style-queue.'
+          if (text.match(style_queue_comment_marker))
+            $.merge(comments, scanForStyleQueueComments(text));
         });
         displayPreviousComments(comments);
       });