544 |
544 |
545 repo.hook('preoutgoing', throw=True, source=source) |
545 repo.hook('preoutgoing', throw=True, source=source) |
546 _changegroupinfo(repo, csets, source) |
546 _changegroupinfo(repo, csets, source) |
547 return bundler.generate(commonrevs, csets, fastpathlinkrev, source) |
547 return bundler.generate(commonrevs, csets, fastpathlinkrev, source) |
548 |
548 |
549 def getsubset(repo, outgoing, bundler, source, fastpath=False): |
549 def getsubset(repo, outgoing, bundler, source, fastpath=False, version='01'): |
550 gengroup = getsubsetraw(repo, outgoing, bundler, source, fastpath) |
550 gengroup = getsubsetraw(repo, outgoing, bundler, source, fastpath) |
551 return cg1unpacker(util.chunkbuffer(gengroup), 'UN') |
551 return packermap[version][1](util.chunkbuffer(gengroup), 'UN') |
552 |
552 |
553 def changegroupsubset(repo, roots, heads, source): |
553 def changegroupsubset(repo, roots, heads, source, version='01'): |
554 """Compute a changegroup consisting of all the nodes that are |
554 """Compute a changegroup consisting of all the nodes that are |
555 descendants of any of the roots and ancestors of any of the heads. |
555 descendants of any of the roots and ancestors of any of the heads. |
556 Return a chunkbuffer object whose read() method will return |
556 Return a chunkbuffer object whose read() method will return |
557 successive changegroup chunks. |
557 successive changegroup chunks. |
558 |
558 |
570 csets, roots, heads = cl.nodesbetween(roots, heads) |
570 csets, roots, heads = cl.nodesbetween(roots, heads) |
571 discbases = [] |
571 discbases = [] |
572 for n in roots: |
572 for n in roots: |
573 discbases.extend([p for p in cl.parents(n) if p != nullid]) |
573 discbases.extend([p for p in cl.parents(n) if p != nullid]) |
574 outgoing = discovery.outgoing(cl, discbases, heads) |
574 outgoing = discovery.outgoing(cl, discbases, heads) |
575 bundler = cg1packer(repo) |
575 bundler = packermap[version][0](repo) |
576 return getsubset(repo, outgoing, bundler, source) |
576 return getsubset(repo, outgoing, bundler, source, version=version) |
577 |
577 |
578 def getlocalchangegroupraw(repo, source, outgoing, bundlecaps=None, |
578 def getlocalchangegroupraw(repo, source, outgoing, bundlecaps=None, |
579 version='01'): |
579 version='01'): |
580 """Like getbundle, but taking a discovery.outgoing as an argument. |
580 """Like getbundle, but taking a discovery.outgoing as an argument. |
581 |
581 |