comparison mercurial/wireprotov1server.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 3d5fb6cab832
children d2e1dcd4490d
comparison
equal deleted inserted replaced
45143:5631b0116374 45144:c93dd9d9f1e6
337 337
338 @wireprotocommand(b'changegroup', b'roots', permission=b'pull') 338 @wireprotocommand(b'changegroup', b'roots', permission=b'pull')
339 def changegroup(repo, proto, roots): 339 def changegroup(repo, proto, roots):
340 nodes = wireprototypes.decodelist(roots) 340 nodes = wireprototypes.decodelist(roots)
341 outgoing = discovery.outgoing( 341 outgoing = discovery.outgoing(
342 repo, missingroots=nodes, missingheads=repo.heads() 342 repo, missingroots=nodes, ancestorsof=repo.heads()
343 ) 343 )
344 cg = changegroupmod.makechangegroup(repo, outgoing, b'01', b'serve') 344 cg = changegroupmod.makechangegroup(repo, outgoing, b'01', b'serve')
345 gen = iter(lambda: cg.read(32768), b'') 345 gen = iter(lambda: cg.read(32768), b'')
346 return wireprototypes.streamres(gen=gen) 346 return wireprototypes.streamres(gen=gen)
347 347
348 348
349 @wireprotocommand(b'changegroupsubset', b'bases heads', permission=b'pull') 349 @wireprotocommand(b'changegroupsubset', b'bases heads', permission=b'pull')
350 def changegroupsubset(repo, proto, bases, heads): 350 def changegroupsubset(repo, proto, bases, heads):
351 bases = wireprototypes.decodelist(bases) 351 bases = wireprototypes.decodelist(bases)
352 heads = wireprototypes.decodelist(heads) 352 heads = wireprototypes.decodelist(heads)
353 outgoing = discovery.outgoing(repo, missingroots=bases, missingheads=heads) 353 outgoing = discovery.outgoing(repo, missingroots=bases, ancestorsof=heads)
354 cg = changegroupmod.makechangegroup(repo, outgoing, b'01', b'serve') 354 cg = changegroupmod.makechangegroup(repo, outgoing, b'01', b'serve')
355 gen = iter(lambda: cg.read(32768), b'') 355 gen = iter(lambda: cg.read(32768), b'')
356 return wireprototypes.streamres(gen=gen) 356 return wireprototypes.streamres(gen=gen)
357 357
358 358