RESOLVED FIXED 46061
svn-apply updates date of wrong change log entry for a change log diff that contains two consecutive entries with the same author and date
https://bugs.webkit.org/show_bug.cgi?id=46061
Summary svn-apply updates date of wrong change log entry for a change log diff that c...
Daniel Bates
Reported 2010-09-19 15:27:59 PDT
Consider the following change log patch: --- ChangeLog +++ ChangeLog @@ -70,6 +70,14 @@ 2010-09-18 Alice <alice@email.address> + Reviewed by NOBODY (OOPS!). + + Changed some more code on 2010-09-18. + + * File: + +2010-09-18 Alice <alice@email.address> + Reviewed by Ray. Changed some code on 2010-09-18. Suppose we apply this patch using svn-apply on 09/19/2010. Looking at the resulting ChangeLog, we have: 2010-09-18 Alice <alice@email.address> Reviewed by NOBODY (OOPS!). Changed some more code on 2010-09-18. * File: 2010-09-19 Alice <alice@email.address> Reviewed by Ray. Changed some code on 2010-09-18. Notice, the date of the earlier entry was changed.
Attachments
Unit test (1.34 KB, patch)
2010-09-19 15:30 PDT, Daniel Bates
no flags
Patch with test cases (11.10 KB, patch)
2010-12-26 23:33 PST, Daniel Bates
no flags
Patch with test cases (11.00 KB, patch)
2010-12-28 16:28 PST, Daniel Bates
no flags
Daniel Bates
Comment 1 2010-09-19 15:30:02 PDT
Created attachment 68037 [details] Unit test
Daniel Bates
Comment 2 2010-09-19 15:35:30 PDT
(In reply to comment #0) > Suppose we apply this patch using svn-apply on 09/19/2010. Looking at the resulting ChangeLog, we have: > I mean't to say: "Looking at the resulting ChangeLog and assuming the name of the reviewer(s) was not specified to svn-apply, we have:"
Daniel Bates
Comment 3 2010-12-26 23:33:46 PST
Created attachment 77480 [details] Patch with test cases Moved unit test into new file fixChangeLogPatchThenSetChangeLogDateAndReviewer.pl because it tests setChangeLogDateAndReviewer(fixChangeLogPatch()). Note, this patch modifies the functionality of fixChangeLogPatch() to move entries that are inserted earlier in a ChangeLog to the top of the file. Therefore, future patches that deliberately insert a change log entry earlier (why?) will not be landed by the commit-queue/webkit-patch as the author intended. Instead, the author will need to land such a patch by hand. Maybe we should consider outputting a warning message when svn-apply detects this?
Daniel Bates
Comment 4 2010-12-28 16:28:12 PST
Created attachment 77589 [details] Patch with test cases Removed extraneous comment in added unit test file fixChangeLogPatchThenSetChangeLogDateAndReviewer.pl. Strengthened for-loop for updating the date state index by noticing that if there exists a line L_i that matches the regular expression $dateStartRegEx after shifting the overlapping lines towards the front then i \in [$chunkStartIndex, $dateStartIndex - 1].
Daniel Bates
Comment 5 2010-12-29 22:04:17 PST
Comment on attachment 77589 [details] Patch with test cases Clearing flags on attachment: 77589 Committed r74780: <http://trac.webkit.org/changeset/74780>
Daniel Bates
Comment 6 2010-12-29 22:04:25 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.