[SCM] WebKit Debian packaging branch, debian/experimental, updated. debian/1.3.8-1-1049-g2e11a8e
ojan at chromium.org
ojan at chromium.org
Fri Jan 21 14:59:59 UTC 2011
The following commit has been merged in the debian/experimental branch:
commit 10618cf892d889a77e52b2d2539620b0903638a0
Author: ojan at chromium.org <ojan at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Jan 6 03:19:45 2011 +0000
2011-01-05 Ojan Vafai <ojan at chromium.org>
Reviewed by Adam Barth.
minor code cleanup for code review tool
https://bugs.webkit.org/show_bug.cgi?id=51962
Consolidates some queries to using shared functions.
* code-review.js:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75131 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Websites/bugs.webkit.org/ChangeLog b/Websites/bugs.webkit.org/ChangeLog
index d91322e..405c32a 100644
--- a/Websites/bugs.webkit.org/ChangeLog
+++ b/Websites/bugs.webkit.org/ChangeLog
@@ -2,6 +2,17 @@
Reviewed by Adam Barth.
+ minor code cleanup for code review tool
+ https://bugs.webkit.org/show_bug.cgi?id=51962
+
+ Consolidates some queries to using shared functions.
+
+ * code-review.js:
+
+2011-01-05 Ojan Vafai <ojan at chromium.org>
+
+ Reviewed by Adam Barth.
+
assorted cleanups to prepare for side-by-side diffing
https://bugs.webkit.org/show_bug.cgi?id=51961
diff --git a/Websites/bugs.webkit.org/code-review.js b/Websites/bugs.webkit.org/code-review.js
index 9163cf0..ccdc4d8 100644
--- a/Websites/bugs.webkit.org/code-review.js
+++ b/Websites/bugs.webkit.org/code-review.js
@@ -539,6 +539,10 @@
return Number(line.querySelector('.to').textContent);
}
+ function textContentsFor(line) {
+ return $('.text', line).text();
+ }
+
function lineNumberForFirstNonContextLine(patched_file, line, prev_line, context, hunk_num) {
if (context.length) {
var prev_line_num = fromLineNumber(prev_line) - 1;
@@ -566,7 +570,7 @@
for (var j = 0, lines_len = lines.length; j < lines_len; j++) {
var line = lines[j];
- var line_contents = line.querySelector('.text').textContent;
+ var line_contents = textContentsFor(line);
if ($(line).hasClass('add')) {
if (current_line == -1) {
current_line = lineNumberForFirstNonContextLine(patched_file, line, lines[j-1], context, hunk_num);
@@ -789,8 +793,7 @@
action = '+';
else if ($(this).hasClass('remove'))
action = '-';
- var text = $(this).children('.text').text();
- snippets.push(indent + action + text);
+ snippets.push(indent + action + textContentsFor(this));
});
return snippets.join('\n');
}
@@ -805,7 +808,7 @@
function snippetFor(line, indent) {
var file_name = fileNameFor(line);
- var line_number = line.hasClass('remove') ? '-' + line.children('.from').text() : line.children('.to').text();
+ var line_number = line.hasClass('remove') ? '-' + fromLineNumber(line[0]) : toLineNumber(line[0]);
return indent + file_name + ':' + line_number + '\n' + contextSnippetFor(line, indent);
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list