[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.22-985-g3c00f00
aroben at apple.com
aroben at apple.com
Wed Mar 17 18:36:07 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 4a08015c0cd57ebb9bfa5e1b2a2a9bc9b46e14e9
Author: aroben at apple.com <aroben at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Mar 12 15:12:42 2010 +0000
Make svn-create-patch's diffs of ObjC header files more readable
Fixes <http://webkit.org/b/36055>.
Reviewed by John Sullivan.
* Scripts/svn-create-patch:
(diffOptionsForFile): Added. Returns the options that should be passed
to diff for the given file. All the options are the same for all
files, except for the option to specify which lines should be used as
hunk headers.
(generateDiff): Use diffOptionsForFile to get the options to pass to
diff.
(hunkHeaderLineRegExForFile): Added. Returns the regular expression
that should be used by diff to identify lines that should be included
after the "@@" in the hunk header lines of the diff. For ObjC[++]
source files, we use any lines starting with -, +, or
@implementation/@interface/@protocol. For ObjC[++] header files (which
we assume to be any .h files in a mac/ or objc/ directory), we use any
lines starting with @implementation/@interface/@protocol.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55898 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 214b17b..a7b24ce 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,26 @@
+2010-03-12 Adam Roben <aroben at apple.com>
+
+ Make svn-create-patch's diffs of ObjC header files more readable
+
+ Fixes <http://webkit.org/b/36055>.
+
+ Reviewed by John Sullivan.
+
+ * Scripts/svn-create-patch:
+ (diffOptionsForFile): Added. Returns the options that should be passed
+ to diff for the given file. All the options are the same for all
+ files, except for the option to specify which lines should be used as
+ hunk headers.
+ (generateDiff): Use diffOptionsForFile to get the options to pass to
+ diff.
+ (hunkHeaderLineRegExForFile): Added. Returns the regular expression
+ that should be used by diff to identify lines that should be included
+ after the "@@" in the hunk header lines of the diff. For ObjC[++]
+ source files, we use any lines starting with -, +, or
+ @implementation/@interface/@protocol. For ObjC[++] header files (which
+ we assume to be any .h files in a mac/ or objc/ directory), we use any
+ lines starting with @implementation/@interface/@protocol.
+
2010-03-12 Jochen Eisinger <jochen at chromium.org>
Reviewed by Jeremy Orlow.
diff --git a/WebKitTools/Scripts/svn-create-patch b/WebKitTools/Scripts/svn-create-patch
index 2361cc5..bbfea6b 100755
--- a/WebKitTools/Scripts/svn-create-patch
+++ b/WebKitTools/Scripts/svn-create-patch
@@ -56,12 +56,14 @@ use Time::gmtime;
use VCSUtils;
sub binarycmp($$);
+sub diffOptionsForFile($);
sub findBaseUrl($);
sub findMimeType($;$);
sub findModificationType($);
sub findSourceFileAndRevision($);
sub generateDiff($$);
sub generateFileList($\%);
+sub hunkHeaderLineRegExForFile($);
sub isBinaryMimeType($);
sub manufacturePatchForAdditionWithHistory($);
sub numericcmp($$);
@@ -130,6 +132,19 @@ sub binarycmp($$)
return $fileDataA->{isBinary} <=> $fileDataB->{isBinary};
}
+sub diffOptionsForFile($)
+{
+ my ($file) = @_;
+
+ my $options = "uaNp";
+
+ if (my $hunkHeaderLineRegEx = hunkHeaderLineRegExForFile($file)) {
+ $options .= "F'$hunkHeaderLineRegEx'";
+ }
+
+ return $options;
+}
+
sub findBaseUrl($)
{
my ($infoPath) = @_;
@@ -203,7 +218,9 @@ sub generateDiff($$)
if ($fileData->{modificationType} eq "additionWithHistory") {
manufacturePatchForAdditionWithHistory($fileData);
}
- open DIFF, "svn diff --diff-cmd diff -x -uaNpF'^[-+@]' '$file' |" or die;
+
+ my $diffOptions = diffOptionsForFile($file);
+ open DIFF, "svn diff --diff-cmd diff -x -$diffOptions '$file' |" or die;
while (<DIFF>) {
$patch .= $_;
}
@@ -252,6 +269,15 @@ sub generateFileList($\%)
close STAT;
}
+sub hunkHeaderLineRegExForFile($)
+{
+ my ($file) = @_;
+
+ my $startOfObjCInterfaceRegEx = "@(implementation\\|interface\\|protocol)";
+ return "^[-+]\\|$startOfObjCInterfaceRegEx" if $file =~ /\.mm?$/;
+ return "^$startOfObjCInterfaceRegEx" if $file =~ /^(.*\/)?(mac|objc)\// && $file =~ /\.h$/;
+}
+
sub isBinaryMimeType($)
{
my ($file) = @_;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list