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

Matt Mackall mpm at selenic.com
Tue Feb 22 10:40:16 CST 2011


On Tue, 2011-02-22 at 16:32 +0100, Martin Geisler wrote:
> 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.

Guess who forgot to qref before pushing...

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list