mercurial/setdiscovery.py
changeset 46806 2b1b8f3e6510
parent 46805 f165105400d0
child 46841 e7b4607d52e3
equal deleted inserted replaced
46805:f165105400d0 46806:2b1b8f3e6510
   427             return ownheadhashes, True, srvheadhashes
   427             return ownheadhashes, True, srvheadhashes
   428 
   428 
   429     # full blown discovery
   429     # full blown discovery
   430 
   430 
   431     # if the server has a limit to its arguments size, we can't grow the sample.
   431     # if the server has a limit to its arguments size, we can't grow the sample.
   432     grow_sample = local.ui.configbool(b'devel', b'discovery.grow-sample')
   432     configbool = local.ui.configbool
       
   433     grow_sample = configbool(b'devel', b'discovery.grow-sample')
   433     grow_sample = grow_sample and not remote.limitedarguments
   434     grow_sample = grow_sample and not remote.limitedarguments
       
   435 
       
   436     dynamic_sample = configbool(b'devel', b'discovery.grow-sample.dynamic')
       
   437     hard_limit_sample = not (dynamic_sample or remote.limitedarguments)
   434 
   438 
   435     randomize = ui.configbool(b'devel', b'discovery.randomize')
   439     randomize = ui.configbool(b'devel', b'discovery.randomize')
   436     disco = partialdiscovery(
   440     disco = partialdiscovery(
   437         local, ownheads, not grow_sample, randomize=randomize
   441         local, ownheads, hard_limit_sample, randomize=randomize
   438     )
   442     )
   439     if initial_head_exchange:
   443     if initial_head_exchange:
   440         # treat remote heads (and maybe own heads) as a first implicit sample
   444         # treat remote heads (and maybe own heads) as a first implicit sample
   441         # response
   445         # response
   442         disco.addcommons(knownsrvheads)
   446         disco.addcommons(knownsrvheads)