comparison mercurial/bundle2.py @ 45144:c93dd9d9f1e6

discovery: change users of `outgoing.missingheads` to `outgoing.ancestorsof` The attribute `missingheads` was recently renamed to `ancestorsof`, as it, despite the old name, doesn’t contain the missing heads but the changesets that were requested (including ancestors) for the outgoing operation. Changing all the users enables to print a warning if the old name is used. There is a good chance that some of the users are buggy because of the old name. Changing them to use the new name makes it more obvious that they are buggy. All users need to be reviewed for bugs. When sending patches for fixing them, the change will be more obvious without having to explain again and again the discrepancy of the old attribute name and what it actually contained.
author Manuel Jacob <me@manueljacob.de>
date Fri, 17 Jul 2020 09:20:48 +0200
parents b1e51ef4e536
children e58e234096de
comparison
equal deleted inserted replaced
45143:5631b0116374 45144:c93dd9d9f1e6
1709 if b'clcount' in cg.extras: 1709 if b'clcount' in cg.extras:
1710 part.addparam( 1710 part.addparam(
1711 b'nbchanges', b'%d' % cg.extras[b'clcount'], mandatory=False 1711 b'nbchanges', b'%d' % cg.extras[b'clcount'], mandatory=False
1712 ) 1712 )
1713 if opts.get(b'phases') and repo.revs( 1713 if opts.get(b'phases') and repo.revs(
1714 b'%ln and secret()', outgoing.missingheads 1714 b'%ln and secret()', outgoing.ancestorsof
1715 ): 1715 ):
1716 part.addparam( 1716 part.addparam(
1717 b'targetphase', b'%d' % phases.secret, mandatory=False 1717 b'targetphase', b'%d' % phases.secret, mandatory=False
1718 ) 1718 )
1719 if b'exp-sidedata-flag' in repo.requirements: 1719 if b'exp-sidedata-flag' in repo.requirements:
1751 # We don't bother using a generator to produce output data because 1751 # We don't bother using a generator to produce output data because
1752 # a) we only have 40 bytes per head and even esoteric numbers of heads 1752 # a) we only have 40 bytes per head and even esoteric numbers of heads
1753 # consume little memory (1M heads is 40MB) b) we don't want to send the 1753 # consume little memory (1M heads is 40MB) b) we don't want to send the
1754 # part if we don't have entries and knowing if we have entries requires 1754 # part if we don't have entries and knowing if we have entries requires
1755 # cache lookups. 1755 # cache lookups.
1756 for node in outgoing.missingheads: 1756 for node in outgoing.ancestorsof:
1757 # Don't compute missing, as this may slow down serving. 1757 # Don't compute missing, as this may slow down serving.
1758 fnode = cache.getfnode(node, computemissing=False) 1758 fnode = cache.getfnode(node, computemissing=False)
1759 if fnode is not None: 1759 if fnode is not None:
1760 chunks.extend([node, fnode]) 1760 chunks.extend([node, fnode])
1761 1761