##// END OF EJS Templates
discovery: new devel.discovery.randomize option...
Georges Racinet -
r42969:334c1ea5 default
parent child Browse files
Show More
@@ -415,6 +415,9 b" coreconfigitem('devel', 'debug.extension"
415 coreconfigitem('devel', 'debug.peer-request',
415 coreconfigitem('devel', 'debug.peer-request',
416 default=False,
416 default=False,
417 )
417 )
418 coreconfigitem('devel', 'discovery.randomize',
419 default=True,
420 )
418 _registerdiffopts(section='diff')
421 _registerdiffopts(section='diff')
419 coreconfigitem('email', 'bcc',
422 coreconfigitem('email', 'bcc',
420 default=None,
423 default=None,
@@ -390,7 +390,9 b' def findcommonheads(ui, local, remote,'
390
390
391 # full blown discovery
391 # full blown discovery
392
392
393 disco = partialdiscovery(local, ownheads, remote.limitedarguments)
393 randomize = ui.configbool('devel', 'discovery.randomize')
394 disco = partialdiscovery(local, ownheads, remote.limitedarguments,
395 randomize=randomize)
394 # treat remote heads (and maybe own heads) as a first implicit sample
396 # treat remote heads (and maybe own heads) as a first implicit sample
395 # response
397 # response
396 disco.addcommons(knownsrvheads)
398 disco.addcommons(knownsrvheads)
@@ -968,7 +968,7 b' One with >200 heads. We now switch to se'
968 updating to branch b
968 updating to branch b
969 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
969 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
970
970
971 $ hg -R a debugdiscovery b --debug --verbose --config progress.debug=true
971 $ hg -R a debugdiscovery b --debug --verbose --config progress.debug=true --config devel.discovery.randomize=false
972 comparing with b
972 comparing with b
973 query 1; heads
973 query 1; heads
974 searching for changes
974 searching for changes
@@ -980,13 +980,14 b' One with >200 heads. We now switch to se'
980 query 3; still undecided: 980, sample size is: 200
980 query 3; still undecided: 980, sample size is: 200
981 sampling from both directions
981 sampling from both directions
982 searching: 4 queries
982 searching: 4 queries
983 query 4; still undecided: 435, sample size is: 210 (no-py3 !)
983 query 4; still undecided: 497, sample size is: 210
984 query 4; still undecided: 430, sample size is: 210 (py3 !)
985 sampling from both directions
984 sampling from both directions
986 searching: 5 queries
985 searching: 5 queries
987 query 5; still undecided: 185, sample size is: 185 (no-py3 !)
986 query 5; still undecided: 285, sample size is: 220
988 query 5; still undecided: 187, sample size is: 187 (py3 !)
987 sampling from both directions
989 5 total queries in *.????s (glob)
988 searching: 6 queries
989 query 6; still undecided: 63, sample size is: 63
990 6 total queries in *.????s (glob)
990 elapsed time: * seconds (glob)
991 elapsed time: * seconds (glob)
991 heads summary:
992 heads summary:
992 total common heads: 1
993 total common heads: 1
@@ -1095,16 +1096,9 b" The case where all the 'initialsamplesiz"
1095 give 'all remote heads known locally' without checking the remaining heads -
1096 give 'all remote heads known locally' without checking the remaining heads -
1096 fixed in 86c35b7ae300:
1097 fixed in 86c35b7ae300:
1097
1098
1098 $ cat >> $TESTTMP/unrandomsample.py << EOF
1099 > import random
1100 > def sample(population, k):
1101 > return sorted(population)[:k]
1102 > random.sample = sample
1103 > EOF
1104
1105 $ cat >> r1/.hg/hgrc << EOF
1099 $ cat >> r1/.hg/hgrc << EOF
1106 > [extensions]
1100 > [devel]
1107 > unrandomsample = $TESTTMP/unrandomsample.py
1101 > discovery.randomize = False
1108 > EOF
1102 > EOF
1109
1103
1110 $ hg -R r1 outgoing r2 -T'{rev} ' --config extensions.blackbox= \
1104 $ hg -R r1 outgoing r2 -T'{rev} ' --config extensions.blackbox= \
General Comments 0
You need to be logged in to leave comments. Login now