Bug 9693 - svn-apply should set ChangeLog date correctly when applying patches
Summary: svn-apply should set ChangeLog date correctly when applying patches
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-02 06:18 PDT by Mark Rowe (bdash)
Modified: 2006-07-09 20:40 PDT (History)
4 users (show)

See Also:


Attachments
Patch v1 (5.25 KB, patch)
2006-07-09 07:36 PDT, David Kilzer (:ddkilzer)
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Rowe (bdash) 2006-07-02 06:18:11 PDT
In the case of small patches which are prepared, reviewed and committed within a single day it can be problematic as committers need to ensure that the date in the ChangeLog is correct relative to other dates within the file.

For instance, if I were to prepare a patch at 01:00 AM NZDT today the date would be written to the ChangeLog as 2006-07-03.  It's still 2006-07-02 for another ~18ish hours in Cupertino which means that if other patches were submitted + committed they would show with an earlier date even though they occurred afterwards.

This issue could be partially resolved by always inserting the date in a consistent timezone, likely PST or PDT, rather than the local time zone.  That said, for patches that take > 1 day to go through the prepare/review/commit cycle the date would need to be updated anyway... so perhaps this isn't a big deal.
Comment 1 David Kilzer (:ddkilzer) 2006-07-02 06:20:33 PDT
In addition to fixing prepare-ChangeLog, it would be neat if svn-apply could change the date in the ChangeLog entry to Cupertino-time (and make svn-unapply handle the back-out cleanly as well).

Comment 2 David Kilzer (:ddkilzer) 2006-07-09 04:29:40 PDT
I'm changing the sense of this bug so that svn-apply sets the ChangeLog entry date when it applies a ChangeLog patch, and svn-unapply knows how to back it out again (Comment #2).  There's no use doing it with prepare-ChangeLog since that isn't the last thing run before committing.  And committers have one less thing to think about when committing patches!

Comment 3 David Kilzer (:ddkilzer) 2006-07-09 07:36:38 PDT
Created attachment 9297 [details]
Patch v1

Changes in this patch:

- svn-apply changes the ChangeLog entry date in the patch before applying it to the actual ChangeLog file.  The new entry date is calculated using the "PST8PDT" timezone (Apple's home) by setting the TZ environment variable, formatting the "local" time in a string, then resetting the TZ env variable.  This works under Cygwin on Windows as well.
- svn-unapply reads the current ChangeLog entry date contained in the file and changes the patch before unapplying it.
Comment 4 Darin Adler 2006-07-09 17:36:03 PDT
Comment on attachment 9297 [details]
Patch v1

Can we make it use the current time zone on Mac OS X automatically?

r=me
Comment 5 David Kilzer (:ddkilzer) 2006-07-09 17:49:04 PDT
(In reply to comment #4)
> (From update of attachment 9297 [details] [edit])
> Can we make it use the current time zone on Mac OS X automatically?

I will add a comment about why "PST8PDT" is the default time zone for the project, and what the code that sets the TZ environment variable is doing (but only a one-line comment).
Comment 6 David Kilzer (:ddkilzer) 2006-07-09 20:40:28 PDT
Committed revision 15279.