incorrect timezones in darcs-fast-export

Bug #538933 reported by Daniel Herring
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar Fast Import
Medium
Unassigned

Bug Description

The attached patch (from git-format-patch) "works for me". It probably needs more testing. I also caution that conversions with it may not match earlier conversions; but the old conversions seem buggy to me.

The commit message follows.

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"

Related branches

Revision history for this message
Daniel Herring (dherring) wrote :
Revision history for this message
Miklos Vajna (vmiklos) wrote : Re: [Bug 538933] [NEW] incorrect timezones in darcs-fast-export

On Mon, Mar 15, 2010 at 05:52:41AM -0000, Daniel Herring <email address hidden> wrote:
> The attached patch (from git-format-patch) "works for me". It probably
> needs more testing. I also caution that conversions with it may not
> match earlier conversions; but the old conversions seem buggy to me.

Thanks, looks good. I want to give it a bit more testing, then I will
push it to my public integration branch and propose a merge request.

Revision history for this message
Daniel Herring (dherring) wrote :

Hold off on releasing this patch; I suspect it is wrong. Last night, I looked at ~40 darcs repos. Although several were from Europe, "darcs changes" always showed times in EST or EDT -- my local US/Eastern timezone. Thus I think the times are now correct, but still potentially in the wrong timezone. It may be that darcs stores all times in UTC; but I've seen another darcs->git conversion that makes me think some tool might have it right. Will investigate.

Revision history for this message
Miklos Vajna (vmiklos) wrote : Re: [Bug 538933] Re: incorrect timezones in darcs-fast-export

On Wed, Mar 17, 2010 at 04:37:44PM -0000, Daniel Herring <email address hidden> wrote:
> Hold off on releasing this patch; I suspect it is wrong. Last night, I
> looked at ~40 darcs repos. Although several were from Europe, "darcs
> changes" always showed times in EST or EDT -- my local US/Eastern
> timezone. Thus I think the times are now correct, but still potentially
> in the wrong timezone. It may be that darcs stores all times in UTC;
> but I've seen another darcs->git conversion that makes me think some
> tool might have it right. Will investigate.

Given that it did not break any of my previous tests, I pushed it
already. But please send an incremental fixup patch if you find
something.

Thanks.

Revision history for this message
Daniel Herring (dherring) wrote :

Ok, I've sorted it out. Looking at the other darcs->git conversion, I was able to properly identify the commiter's home country (Finland). Nothing to learn from that conversion.

It took me a while to find docs, but Darcs stores UTC timestamps, and converts them to "local" time for user display.
http://wiki.darcs.net/NamedPatch
http://search.cpan.org/~david/Darcs-Inventory-1.4/lib/Darcs/Inventory/Patch.pm
http://bugs.darcs.net/issue140

Since all information about the actual timezone is lost, I believe the proper thing is to always report UTC. See the attached patch. It applies on top of the previous one.

Revision history for this message
Miklos Vajna (vmiklos) wrote :

Thanks both and sorry for the really slow answer.

Miklos Vajna (vmiklos)
Changed in bzr-fastimport:
status: New → Fix Committed
Jelmer Vernooij (jelmer)
Changed in bzr-fastimport:
importance: Undecided → Medium
Jelmer Vernooij (jelmer)
Changed in bzr-fastimport:
status: Fix Committed → Fix Released
milestone: none → 0.10.0
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.