[PATCH] test_pack_revision_5 failure on Windows
John Arbash Meinel
john at arbash-meinel.com
Tue Nov 7 22:28:19 GMT 2006
Henri Wiechers wrote:
> I've been looking at some of the selftest failures on Windows. One
> such failure is:
...
>
> I did a little checking and it seems that this isn't regarded as a
> bug. Floats are
> really only good for 17 significant digits and the timestamp attribute
> is holding 19.
> (Even repr(float) rounds to 17 first.)
>
> The attached patch gets the right timestamp attribute by using
> "%i" % float_ + ("%.9f" % (float_ - int(float_)))[1:]
> Ideally, though, I think that repr(rev.timestamp) should be used instead
> of a
> format with fixed decimal places.
New versions of bzr actually always round to milliseconds. So what if we
just change the time to:
timestamp = 1125907235.212000000
We've talked about changing the field to some sort of integer. But I'm
pretty sure milliseconds is stable enough. Floats should be able to
represent timestamp down to milliseconds, which is only 13 significant
places. And it will be a long time before we get anywhere near 16
significant places. (If I did the math right, it is some time in the
year 316,880).
Also, the bundle you attached was attached as a binary attachment. Maybe
calling it .diff would make it show up as text. Worst case, you can just
attach a '.txt' file. It already needs to have line endings converted
even as a octet stream, so we might as well not worry about it.
John
=:->
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20061107/8c4c85de/attachment.pgp
More information about the bazaar
mailing list