RESOLVED FIXED Bug 167903
File index appended to previous file in svn-create-patch with SVN 1.9
https://bugs.webkit.org/show_bug.cgi?id=167903
Summary File index appended to previous file in svn-create-patch with SVN 1.9
Sam Weinig
Reported 2017-02-06 13:26:23 PST
The EWS bot does not seem to be able to apply the patch in 167806. The patch posted using webkit-patch post from an up-to-date tree.
Attachments
Patch (1.17 KB, patch)
2017-02-07 11:08 PST, Jonathan Bedard
no flags
Patch (3.25 KB, patch)
2017-02-07 11:43 PST, Jonathan Bedard
dbates: review-
Patch and unit tests (3.12 KB, patch)
2017-02-07 12:19 PST, Daniel Bates
no flags
Patch and unit tests (3.11 KB, patch)
2017-02-07 12:20 PST, Daniel Bates
no flags
Radar WebKit Bug Importer
Comment 1 2017-02-06 16:37:16 PST
Jonathan Bedard
Comment 2 2017-02-07 08:07:36 PST
*** This bug has been marked as a duplicate of bug 167906 ***
Alexey Proskuryakov
Comment 3 2017-02-07 09:04:42 PST
Let's track the issue in this older bug.
Alexey Proskuryakov
Comment 4 2017-02-07 09:05:01 PST
*** Bug 167906 has been marked as a duplicate of this bug. ***
Jonathan Bedard
Comment 5 2017-02-07 11:06:28 PST
Actually, this is an issue I've seen locally, it's just now that I've noticed what the root cause is. SVN 1.9 doesn't always emit newlines at the end of patches, and we don't explicitly add them. Sometimes the index line of the next file gets appended to the last line of the previous file.
Jonathan Bedard
Comment 6 2017-02-07 11:08:37 PST
Jonathan Bedard
Comment 7 2017-02-07 11:17:32 PST
If you search for 'Index: Source/WebCore/bindings/js/JSDOMConvertBase.h' in https://bug-167806-attachments.webkit.org/attachment.cgi?id=300583, you will see an example of a file index being appended to the previous change.
Jonathan Bedard
Comment 8 2017-02-07 11:43:47 PST
Daniel Bates
Comment 9 2017-02-07 11:53:39 PST
Comment on attachment 300829 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=300829&action=review > Tools/Scripts/svn-create-patch:245 > + $patch eq "" or (substr $patch, -1) eq "\n" or die; We need to make this work for arbitrary end-of-line characters. I would also write this in the form: die if ($patch && $patch =~ /\r?$/); (The regular expression used may not be correct. Please check.)
Daniel Bates
Comment 10 2017-02-07 11:56:46 PST
Comment on attachment 300829 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=300829&action=review > Tools/Scripts/VCSUtils.pm:1782 > + return join($lineEnding, @lines) . $lineEnding; Is it OK to use $lineEnding here?fixChangeLogPatch() has similar logic and emits a new-line character because "patch(1) expects an extra trailing newline".
Daniel Bates
Comment 11 2017-02-07 12:06:00 PST
(In reply to comment #9) > Comment on attachment 300829 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=300829&action=review > > > Tools/Scripts/svn-create-patch:245 > > + $patch eq "" or (substr $patch, -1) eq "\n" or die; > > We need to make this work for arbitrary end-of-line characters. I would also > write this in the form: > > die if ($patch && $patch =~ /\r?$/); > Assuming the comment in fixChangeLogPatch() is true [1], we should write this as: die if ($patch && substr($patch, -1) ne "\n"); [1] <https://trac.webkit.org/browser/trunk/Tools/Scripts/VCSUtils.pm?rev=211828#L1935>
Daniel Bates
Comment 12 2017-02-07 12:09:58 PST
Comment on attachment 300829 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=300829&action=review > Tools/Scripts/webkitperl/VCSUtils_unittest/fixSVNPatchForAdditionWithHistory.pl:47 > + Actually we shouldn't add this line here. Instead we should remove the chomp() from <https://trac.webkit.org/browser/trunk/Tools/Scripts/webkitperl/VCSUtils_unittest/fixSVNPatchForAdditionWithHistory.pl?rev=211828#L285>.
Daniel Bates
Comment 13 2017-02-07 12:19:31 PST
Created attachment 300832 [details] Patch and unit tests
Daniel Bates
Comment 14 2017-02-07 12:20:50 PST
Created attachment 300833 [details] Patch and unit tests
WebKit Commit Bot
Comment 15 2017-02-07 13:04:15 PST
Comment on attachment 300833 [details] Patch and unit tests Clearing flags on attachment: 300833 Committed r211833: <http://trac.webkit.org/changeset/211833>
WebKit Commit Bot
Comment 16 2017-02-07 13:04:19 PST
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.