[bug] different handling of timestamp during commit
John Arbash Meinel
john at arbash-meinel.com
Mon Jul 10 16:34:47 BST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I had reason to inspect the commit code, and I found this:
if timestamp is None:
self._timestamp = time.time()
else:
self._timestamp = long(timestamp)
We've had this code for a while, but it means that if you commit and
don't supply a timestamp we preserve accuracy to nanoseconds (the final
output is %.9f).
But if you supply a timestamp, it truncates it to 1-second precision.
Now, I'm fine with 1-second precision. The timestamp field of revisions
is only as accurate as your local clock, so expecting nanosecond is a
little bit much. We've discussed it a little in the past, and we have to
keep %.9f in our current format, because that is required to have a
Testament match. So we need to keep full precision for backwards
compatibility.
But I think it would be reasonable to say that new commits are only
accurate to something > nanosecond. We could even go to millisecond if
you prefer, with simply:
if timestamp is None:
timestamp = time.time()
self._timestamp = round(timestamp, 3)
But at the very least I would like us to change the code to be
consistent, either have it be:
if timestamp is None:
timestamp = time.time()
self._timestamp = long(timestamp)
or
if timestamp is None:
timestamp = time.time()
self._timestamp = timestamp
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFEsnOXJdeBCYSNAAMRAgwlAJ0S5qt+lNwkbn6YLtfm9eHXycdmWwCglX0b
rUZxBbE3ntRrPYCuRKWPHIk=
=eggH
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list