[PATCH 3 of 3] changegroup: don't accept odd chunk headers

Martin Geisler mg at lazybytes.net
Tue Feb 22 09:32:04 CST 2011


Mads Kiilerich <mads at kiilerich.com> writes:

> On 02/22/2011 02:29 PM, Jim Hague wrote:
>> Hi,
>>
>> (Apologies if I'm the 1000th email on this)
>>
>> This patch breaks pulling and pushing for me, at least from a same-filesystem
>> repo.
>>
>> [...]
>>
>>    File "/home/jim/src/hg-main/mercurial/changegroup.py", line 154, in
>> chunklength
>>      d = readexactly(stream, 4)
>> NameError: global name 'stream' is not defined
>>
>> Fixing what I guess is a typo cures it.
>>
>> diff -r 9f2c407caf34 mercurial/changegroup.py
>> --- a/mercurial/changegroup.py  Tue Feb 22 03:10:37 2011 +0100
>> +++ b/mercurial/changegroup.py  Tue Feb 22 13:27:19 2011 +0000
>> @@ -151,7 +151,7 @@
>>           return self._stream.close()
>>
>>       def chunklength(self):
>> -        d = readexactly(stream, 4)
>> +        d = readexactly(self._stream, 4)
>>           l = struct.unpack(">l", d)[0]
>>           if l<= 4:
>>               if l:
>
> Right, thanks, sorry. I must have missed a qref before bombing :-(
>
> Matt, please unqueue the 3rd patch - or fold it with this fix.

I just pulled the changeset and got the above traceback too, so I added
the fix by Jim and pushed it to crew.

-- 
Martin Geisler

Mercurial links: http://mercurial.ch/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20110222/f7e1dd3f/attachment.pgp>


More information about the Mercurial-devel mailing list