dates in hg export

Jason Harris jason at jasonfharris.com
Tue Jun 15 19:24:11 CDT 2010


Hi All,

I have the following issue: hg export exports something with a header like:

# HG changeset patch
# User jfh <jason at jasonfharris.com>
# Date 1276094100 -7200
# Node ID 8773937a927b6eb701c492a0b2c3c428d0b38519
# Parent  a826b009b706d8faf279e9296492cdd3bdbf62be
some description of the change.

diff --git a/MacHgHelp/MacHgHelp.helpindex b/MacHgHelp/MacHgHelp.helpindex
....


But when this is displayed in MacHg the date looks weird if I display it as is. Its much nicer to display it as an iso-date like 2010-06-09 16:35 +0200, however if I change the file that 'hg export' exports to

# HG changeset patch
# User jfh <jason at jasonfharris.com>
# Date 2010-06-09 16:35 +0200
# Node ID 8773937a927b6eb701c492a0b2c3c428d0b38519
# Parent  a826b009b706d8faf279e9296492cdd3bdbf62be
some description of the change.

diff --git a/MacHgHelp/MacHgHelp.helpindex b/MacHgHelp/MacHgHelp.helpindex
....

even though the iso-date '2010-06-09 16:35 +0200' is the exact same one as the internal Mercurial UTC+offset '1276094100 -7200' the hash codes don't match after import. ie 'hg import isodatepatch' gives a different hash to 'hg import utcoffsetdatepatch' all other things being equal. Ie Mercurial works with isodatepatch with the above changeset, but has a different hashcode.

Thus importing a chain of these with 'hg import --exact' fails.

Should this work? Ie is this a low-level bug? Of course you might think that the exported changes are not meant to be human read, etc. but in reality I suspect they are being read by humans. In fact I read them on an infrequent basis, and want to be able to manipulate them every so often... dealing with the dates in the internal format is awkward. Of course I can translate the internal format into the isoformat in my code, when it struck me that, well... really Mercurial should likely handle these dates interchangeably and still get the same hash code for the patch.

Thoughts?

Cheers,
   Jas


More information about the Mercurial-devel mailing list