mercurial/wireprotov1server.py
changeset 45144 c93dd9d9f1e6
parent 44782 3d5fb6cab832
child 45682 d2e1dcd4490d
equal deleted inserted replaced
45143:5631b0116374 45144:c93dd9d9f1e6
   337 
   337 
   338 @wireprotocommand(b'changegroup', b'roots', permission=b'pull')
   338 @wireprotocommand(b'changegroup', b'roots', permission=b'pull')
   339 def changegroup(repo, proto, roots):
   339 def changegroup(repo, proto, roots):
   340     nodes = wireprototypes.decodelist(roots)
   340     nodes = wireprototypes.decodelist(roots)
   341     outgoing = discovery.outgoing(
   341     outgoing = discovery.outgoing(
   342         repo, missingroots=nodes, missingheads=repo.heads()
   342         repo, missingroots=nodes, ancestorsof=repo.heads()
   343     )
   343     )
   344     cg = changegroupmod.makechangegroup(repo, outgoing, b'01', b'serve')
   344     cg = changegroupmod.makechangegroup(repo, outgoing, b'01', b'serve')
   345     gen = iter(lambda: cg.read(32768), b'')
   345     gen = iter(lambda: cg.read(32768), b'')
   346     return wireprototypes.streamres(gen=gen)
   346     return wireprototypes.streamres(gen=gen)
   347 
   347 
   348 
   348 
   349 @wireprotocommand(b'changegroupsubset', b'bases heads', permission=b'pull')
   349 @wireprotocommand(b'changegroupsubset', b'bases heads', permission=b'pull')
   350 def changegroupsubset(repo, proto, bases, heads):
   350 def changegroupsubset(repo, proto, bases, heads):
   351     bases = wireprototypes.decodelist(bases)
   351     bases = wireprototypes.decodelist(bases)
   352     heads = wireprototypes.decodelist(heads)
   352     heads = wireprototypes.decodelist(heads)
   353     outgoing = discovery.outgoing(repo, missingroots=bases, missingheads=heads)
   353     outgoing = discovery.outgoing(repo, missingroots=bases, ancestorsof=heads)
   354     cg = changegroupmod.makechangegroup(repo, outgoing, b'01', b'serve')
   354     cg = changegroupmod.makechangegroup(repo, outgoing, b'01', b'serve')
   355     gen = iter(lambda: cg.read(32768), b'')
   355     gen = iter(lambda: cg.read(32768), b'')
   356     return wireprototypes.streamres(gen=gen)
   356     return wireprototypes.streamres(gen=gen)
   357 
   357 
   358 
   358