mercurial/wireproto.py
changeset 30187 3e86261bf110
parent 30014 d34cf260d15b
child 30206 d105195436c0
equal deleted inserted replaced
30186:f7ed5af31242 30187:3e86261bf110
   770 
   770 
   771     if not bundle1allowed(repo, 'pull'):
   771     if not bundle1allowed(repo, 'pull'):
   772         if not exchange.bundle2requested(opts.get('bundlecaps')):
   772         if not exchange.bundle2requested(opts.get('bundlecaps')):
   773             return ooberror(bundle2required)
   773             return ooberror(bundle2required)
   774 
   774 
   775     cg = exchange.getbundle(repo, 'serve', **opts)
   775     chunks = exchange.getbundlechunks(repo, 'serve', **opts)
   776     return streamres(proto.groupchunks(cg))
   776     # TODO avoid util.chunkbuffer() here since it is adding overhead to
       
   777     # what is fundamentally a generator proxying operation.
       
   778     return streamres(proto.groupchunks(util.chunkbuffer(chunks)))
   777 
   779 
   778 @wireprotocommand('heads')
   780 @wireprotocommand('heads')
   779 def heads(repo, proto):
   781 def heads(repo, proto):
   780     h = repo.heads()
   782     h = repo.heads()
   781     return encodelist(h) + "\n"
   783     return encodelist(h) + "\n"