[webkit-reviews] review requested: [Bug 34033] svn-apply: Change svn-apply and svn-unapply to use new parsePatch(). : [Attachment 54016] Proposed patch 2
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Wed Apr 21 19:40:43 PDT 2010
Chris Jerdonek <cjerdonek at webkit.org> has asked for review:
Bug 34033: svn-apply: Change svn-apply and svn-unapply to use new parsePatch().
https://bugs.webkit.org/show_bug.cgi?id=34033
Attachment 54016: Proposed patch 2
https://bugs.webkit.org/attachment.cgi?id=54016&action=review
------- Additional Comments from Chris Jerdonek <cjerdonek at webkit.org>
Resubmitting in response to Eric's comments in comment 3.
It's been quite a while since patch #1 was submitted. Since it's been such a
long time, below are the differences this patch has with patch #1:
diff --git a/WebKitTools/Scripts/VCSUtils.pm b/WebKitTools/Scripts/VCSUtils.pm
index 9c0b5bd..6c6f938 100644
--- a/WebKitTools/Scripts/VCSUtils.pm
+++ b/WebKitTools/Scripts/VCSUtils.pm
@@ -611,7 +611,7 @@ sub prepareParsedPatch($@)
my %copiedFiles;
# Return values
- my @copyDiffHashRefs = (); # FIXME: Remove these initializers?
+ my @copyDiffHashRefs = ();
my @nonCopyDiffHashRefs = ();
my %sourceRevisionHash = ();
for my $diffHashRef (@diffHashRefs) {
@@ -624,9 +624,9 @@ sub prepareParsedPatch($@)
# Then the diff is a copy operation.
$sourcePath = $copiedFromPath;
- if (exists($copiedFiles{$indexPath})) {
- die "Index path $indexPath appears twice as a copy target."
unless $shouldForce;
- }
+ # FIXME: Consider printing a warning or exiting if
+ # exists($copiedFiles{$indexPath}) is true -- i.e. if
+ # $indexPath appears twice as a copy target.
$copiedFiles{$indexPath} = $sourcePath;
push @copyDiffHashRefs, $diffHashRef;
diff --git a/WebKitTools/Scripts/svn-apply b/WebKitTools/Scripts/svn-apply
index 20a3f06..13b215b 100755
--- a/WebKitTools/Scripts/svn-apply
+++ b/WebKitTools/Scripts/svn-apply
@@ -128,7 +128,7 @@ my %copiedFiles;
# otherwise get a bareword error.
my @diffHashRefs = parsePatch(*ARGV);
-print "Parsed " . @diffHashRefs . " diffs from patch file.\n";
+print "Parsed " . @diffHashRefs . " diffs from patch file(s).\n";
my $preparedPatchHash = prepareParsedPatch($force, @diffHashRefs);
@@ -303,7 +303,7 @@ sub patch($)
{
my ($diffHashRef) = @_;
- my $patch = $diffHashRef->{svnConvertedText}; # SVN-formatted diff
+ my $patch = $diffHashRef->{svnConvertedText};
unless ($patch =~ m|^Index: ([^\r\n]+)|) {
my $separator = '-' x 67;
diff --git a/WebKitTools/Scripts/svn-unapply b/WebKitTools/Scripts/svn-unapply
index ec66b33..d5b95e8 100755
--- a/WebKitTools/Scripts/svn-unapply
+++ b/WebKitTools/Scripts/svn-unapply
@@ -101,7 +101,7 @@ my %directoriesToCheck;
# otherwise get a bareword error.
my @diffHashRefs = parsePatch(*ARGV);
-print "Parsed " . @diffHashRefs . " diffs from patch file.\n";
+print "Parsed " . @diffHashRefs . " diffs from patch file(s).\n";
my $preparedPatchHash = prepareParsedPatch($force, @diffHashRefs);
@@ -139,7 +139,7 @@ sub patch($)
{
my ($diffHashRef) = @_;
- my $patch = $diffHashRef->{svnConvertedText}; # SVN-formatted diff
+ my $patch = $diffHashRef->{svnConvertedText};
unless ($patch =~ m|^Index: ([^\r\n]+)|) {
my $separator = '-' x 67;
More information about the webkit-reviews
mailing list