comparison mercurial/changegroup.py @ 25677:af5b2f4ed594 stable

changegroup: properly compute common base in changeggroupsubset (issue4736) The computation of roots was buggy, any ancestor of a bundled merge which was also a descendant of the parents of a bundled revision were included as part of the bundle. We fix it and add a test for strip (which revealed the problem). Check the test for a practical usecase.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 29 Jun 2015 11:20:09 -0700
parents 90f2b9de30f2
children ce3d4b858420
comparison
equal deleted inserted replaced
25676:ec9c258e666d 25677:af5b2f4ed594
575 the changegroup a particular filenode or manifestnode belongs to. 575 the changegroup a particular filenode or manifestnode belongs to.
576 """ 576 """
577 cl = repo.changelog 577 cl = repo.changelog
578 if not roots: 578 if not roots:
579 roots = [nullid] 579 roots = [nullid]
580 # TODO: remove call to nodesbetween.
581 csets, roots, heads = cl.nodesbetween(roots, heads)
582 discbases = [] 580 discbases = []
583 for n in roots: 581 for n in roots:
584 discbases.extend([p for p in cl.parents(n) if p != nullid]) 582 discbases.extend([p for p in cl.parents(n) if p != nullid])
583 # TODO: remove call to nodesbetween.
584 csets, roots, heads = cl.nodesbetween(roots, heads)
585 included = set(csets)
586 discbases = [n for n in discbases if n not in included]
585 outgoing = discovery.outgoing(cl, discbases, heads) 587 outgoing = discovery.outgoing(cl, discbases, heads)
586 bundler = packermap[version][0](repo) 588 bundler = packermap[version][0](repo)
587 return getsubset(repo, outgoing, bundler, source, version=version) 589 return getsubset(repo, outgoing, bundler, source, version=version)
588 590
589 def getlocalchangegroupraw(repo, source, outgoing, bundlecaps=None, 591 def getlocalchangegroupraw(repo, source, outgoing, bundlecaps=None,