##// END OF EJS Templates
setdiscovery: add a discovery.grow-sample.dynamic option...
marmoute -
r47562:2b1b8f3e default
parent child Browse files
Show More
@@ -737,6 +737,14 b' coreconfigitem('
737 b'discovery.grow-sample',
737 b'discovery.grow-sample',
738 default=True,
738 default=True,
739 )
739 )
740 # When discovery.grow-sample.dynamic is True, the default, the sample size is
741 # adapted to the shape of the undecided set (it is set to the max of:
742 # <target-size>, len(roots(undecided)), len(heads(undecided)
743 coreconfigitem(
744 b'devel',
745 b'discovery.grow-sample.dynamic',
746 default=True,
747 )
740 # discovery.grow-sample.rate control the rate at which the sample grow
748 # discovery.grow-sample.rate control the rate at which the sample grow
741 coreconfigitem(
749 coreconfigitem(
742 b'devel',
750 b'devel',
@@ -1024,6 +1024,12 b' def debugdiscovery(ui, repo, remoteurl=b'
1024 If False, the sample size used in set discovery will not be increased
1024 If False, the sample size used in set discovery will not be increased
1025 through the process
1025 through the process
1026
1026
1027 * devel.discovery.grow-sample.dynamic=True
1028
1029 When discovery.grow-sample.dynamic is True, the default, the sample size is
1030 adapted to the shape of the undecided set (it is set to the max of:
1031 <target-size>, len(roots(undecided)), len(heads(undecided)
1032
1027 * devel.discovery.grow-sample.rate=1.05
1033 * devel.discovery.grow-sample.rate=1.05
1028
1034
1029 the rate at which the sample grow
1035 the rate at which the sample grow
@@ -429,12 +429,16 b' def findcommonheads('
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
434
435
436 dynamic_sample = configbool(b'devel', b'discovery.grow-sample.dynamic')
437 hard_limit_sample = not (dynamic_sample or remote.limitedarguments)
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
General Comments 0
You need to be logged in to leave comments. Login now