diff -r 39c6e349dfff -r 6d97dd630d79 mercurial/wireproto.py --- a/mercurial/wireproto.py Fri Sep 14 12:05:12 2012 -0700 +++ b/mercurial/wireproto.py Fri Sep 14 12:05:37 2012 -0700 @@ -555,8 +555,11 @@ repo.ui.debug('sending %s (%d bytes)\n' % (name, size)) # partially encode name over the wire for backwards compat yield '%s\0%d\n' % (store.encodedir(name), size) - for chunk in util.filechunkiter(sopener(name), limit=size): - yield chunk + if size <= 65536: + yield sopener(name).read(size) + else: + for chunk in util.filechunkiter(sopener(name), limit=size): + yield chunk finally: sopener.mustaudit = oldaudit