localrepo: make it clear that changegroupsubset doesn't take bases but roots

changegroupsubset will take the parents of the roots to find the bases.

Other parts of Mercurial do not expect that, and a result of that is that some
bundles contain more changesets than necessary.

No real changes here - just renaming a parameter to document what it is.
This commit is contained in:
Mads Kiilerich 2014-02-10 00:52:16 +01:00
parent 859551f9b1
commit a649a1436b

View File

@ -1761,9 +1761,9 @@ class localrepository(object):
for node in nodes:
self.ui.debug("%s\n" % hex(node))
def changegroupsubset(self, bases, heads, source):
def changegroupsubset(self, roots, heads, source):
"""Compute a changegroup consisting of all the nodes that are
descendants of any of the bases and ancestors of any of the heads.
descendants of any of the roots and ancestors of any of the heads.
Return a chunkbuffer object whose read() method will return
successive changegroup chunks.
@ -1775,12 +1775,12 @@ class localrepository(object):
the changegroup a particular filenode or manifestnode belongs to.
"""
cl = self.changelog
if not bases:
bases = [nullid]
if not roots:
roots = [nullid]
# TODO: remove call to nodesbetween.
csets, bases, heads = cl.nodesbetween(bases, heads)
csets, roots, heads = cl.nodesbetween(roots, heads)
discbases = []
for n in bases:
for n in roots:
discbases.extend([p for p in cl.parents(n) if p != nullid])
outgoing = discovery.outgoing(cl, discbases, heads)
bundler = changegroup.bundle10(self)