comparison mercurial/localrepo.py @ 20406:9e331f1f0573

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.
author Mads Kiilerich <madski@unity3d.com>
date Mon, 10 Feb 2014 00:52:16 +0100
parents d4f804caa0ed
children 6b4c789d618d
comparison
equal deleted inserted replaced
20405:cb63aa14aaf7 20406:9e331f1f0573
1759 if self.ui.debugflag: 1759 if self.ui.debugflag:
1760 self.ui.debug("list of changesets:\n") 1760 self.ui.debug("list of changesets:\n")
1761 for node in nodes: 1761 for node in nodes:
1762 self.ui.debug("%s\n" % hex(node)) 1762 self.ui.debug("%s\n" % hex(node))
1763 1763
1764 def changegroupsubset(self, bases, heads, source): 1764 def changegroupsubset(self, roots, heads, source):
1765 """Compute a changegroup consisting of all the nodes that are 1765 """Compute a changegroup consisting of all the nodes that are
1766 descendants of any of the bases and ancestors of any of the heads. 1766 descendants of any of the roots and ancestors of any of the heads.
1767 Return a chunkbuffer object whose read() method will return 1767 Return a chunkbuffer object whose read() method will return
1768 successive changegroup chunks. 1768 successive changegroup chunks.
1769 1769
1770 It is fairly complex as determining which filenodes and which 1770 It is fairly complex as determining which filenodes and which
1771 manifest nodes need to be included for the changeset to be complete 1771 manifest nodes need to be included for the changeset to be complete
1773 1773
1774 Another wrinkle is doing the reverse, figuring out which changeset in 1774 Another wrinkle is doing the reverse, figuring out which changeset in
1775 the changegroup a particular filenode or manifestnode belongs to. 1775 the changegroup a particular filenode or manifestnode belongs to.
1776 """ 1776 """
1777 cl = self.changelog 1777 cl = self.changelog
1778 if not bases: 1778 if not roots:
1779 bases = [nullid] 1779 roots = [nullid]
1780 # TODO: remove call to nodesbetween. 1780 # TODO: remove call to nodesbetween.
1781 csets, bases, heads = cl.nodesbetween(bases, heads) 1781 csets, roots, heads = cl.nodesbetween(roots, heads)
1782 discbases = [] 1782 discbases = []
1783 for n in bases: 1783 for n in roots:
1784 discbases.extend([p for p in cl.parents(n) if p != nullid]) 1784 discbases.extend([p for p in cl.parents(n) if p != nullid])
1785 outgoing = discovery.outgoing(cl, discbases, heads) 1785 outgoing = discovery.outgoing(cl, discbases, heads)
1786 bundler = changegroup.bundle10(self) 1786 bundler = changegroup.bundle10(self)
1787 return self._changegroupsubset(outgoing, bundler, source) 1787 return self._changegroupsubset(outgoing, bundler, source)
1788 1788