Bug 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
Summary: svn-apply updates date of wrong change log entry for a change log diff that c...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Daniel Bates
URL:
Keywords:
Depends on: 46058
Blocks:
  Show dependency treegraph
 
Reported: 2010-09-19 15:27 PDT by Daniel Bates
Modified: 2010-12-29 22:04 PST (History)
4 users (show)

See Also:


Attachments
Unit test (1.34 KB, patch)
2010-09-19 15:30 PDT, Daniel Bates
no flags Details | Formatted Diff | Diff
Patch with test cases (11.10 KB, patch)
2010-12-26 23:33 PST, Daniel Bates
no flags Details | Formatted Diff | Diff
Patch with test cases (11.00 KB, patch)
2010-12-28 16:28 PST, Daniel Bates
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Bates 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.
Comment 1 Daniel Bates 2010-09-19 15:30:02 PDT
Created attachment 68037 [details]
Unit test
Comment 2 Daniel Bates 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:"
Comment 3 Daniel Bates 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?
Comment 4 Daniel Bates 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].
Comment 5 Daniel Bates 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>
Comment 6 Daniel Bates 2010-12-29 22:04:25 PST
All reviewed patches have been landed.  Closing bug.