durin42 added inline comments.
> martinvonz wrote in httppeer.py:96
> It doesn't matter much since it's just a programming error if it happens, but
> how will these arguments to ValueError be rendered?
ValueError: ('_multifile only supports file objects that have a length but this
one does not:', <type 'file'>, <open file 'README', mode 'r' at 0x110ff0b70>)
It ain't pretty, but it's got all the information we need.
> martinvonz wrote in httppeer.py:111
> nit: i think this can be "if got <= amt" to avoid an unnecessary 0-length
> read the next time _multifile.read() (and it does look like that will be the
> normal case, that the reader will read exactly the size of the first "file"
No, because consider these file buffers:
if we read(2), we'll pull 2 bytes off the first buffer, which is not yet
exhausted, but got == amt.
To: durin42, #hg-reviewers
Cc: martinvonz, mercurial-devel
Mercurial-devel mailing list