fix timezones in darcs-fast-export
authorD Herring <dherring@at.tentpost.dot.com>
Wed, 17 Mar 2010 00:14:48 +0000 (01:14 +0100)
committerMiklos Vajna <vmiklos@frugalware.org>
Wed, 17 Mar 2010 00:14:48 +0000 (01:14 +0100)
commitaa64e5ee25870ce8e96a2d9c984713189a6da368
tree7b00e96ecfd441a6a6e2165db104fdc25081ed5b
parentbe66ae19f7c2d5bf89d4a2f7f476dfa339a704f6
fix timezones in darcs-fast-export

Previously, the export was mangling timezones.  There were conversion errors when the darcs TZ
did not match the conversion TZ.  Also, the conversion timezone was always reported (this is
bad since two conversions may now differ).

This patch fixes both problems on my system, but it has not been extensively tested.
Can 'local_date' be used reliably?  What about my TZ manipulations?
I am no expert in darcs or python.  Developed with darcs 2.3.1 and Python 2.6.4.

To check for errors, I compared a darcs repo against a "git darcs fetch" into a new repo.
The following two commands were helpful.
# darcs changes | grep for dates
# git log --pretty=format:%ad REF | cat

Example -- EDT=UTC-4 and EST=UTC-5; I am processing in EDT.
darcs date:
"Fri Mar 31 10:48:00 EST 2006"
Before patch, git reported:
"Fri Mar 31 12:48:00 2006 -0400" (should be 11:48 -0400 or 10:48 -0500)
After patch, git reported:
"Fri Mar 31 10:48:00 2006 -0500"
exporters/darcs/darcs-fast-export