Show More
@@ -275,9 +275,63 b' def findcommonheads(ui, local, remote,' | |||
|
275 | 275 | # early exit if we know all the specified remote heads already |
|
276 | 276 | ui.debug("query 1; heads\n") |
|
277 | 277 | roundtrips += 1 |
|
278 | # We also ask remote about all the local heads. That set can be arbitrarily | |
|
279 | # large, so we used to limit it size to `initialsamplesize`. We no longer | |
|
280 | # do as it proved counter productive. The skipped heads could lead to a | |
|
281 | # large "undecided" set, slower to be clarified than if we asked the | |
|
282 | # question for all heads right away. | |
|
283 | # | |
|
284 | # We are already fetching all server heads using the `heads` commands, | |
|
285 | # sending a equivalent number of heads the other way should not have a | |
|
286 | # significant impact. In addition, it is very likely that we are going to | |
|
287 | # have to issue "known" request for an equivalent amount of revisions in | |
|
288 | # order to decide if theses heads are common or missing. | |
|
289 | # | |
|
290 | # find a detailled analysis below. | |
|
291 | # | |
|
292 | # Case A: local and server both has few heads | |
|
293 | # | |
|
294 | # Ownheads is below initialsamplesize, limit would not have any effect. | |
|
295 | # | |
|
296 | # Case B: local has few heads and server has many | |
|
297 | # | |
|
298 | # Ownheads is below initialsamplesize, limit would not have any effect. | |
|
299 | # | |
|
300 | # Case C: local and server both has many heads | |
|
301 | # | |
|
302 | # We now transfert some more data, but not significantly more than is | |
|
303 | # already transfered to carry the server heads. | |
|
304 | # | |
|
305 | # Case D: local has many heads, server has few | |
|
306 | # | |
|
307 | # D.1 local heads are mostly known remotely | |
|
308 | # | |
|
309 | # All the known head will have be part of a `known` request at some | |
|
310 | # point for the discovery to finish. Sending them all earlier is | |
|
311 | # actually helping. | |
|
312 | # | |
|
313 | # (This case is fairly unlikely, it requires the numerous heads to all | |
|
314 | # be merged server side in only a few heads) | |
|
315 | # | |
|
316 | # D.2 local heads are mostly missing remotely | |
|
317 | # | |
|
318 | # To determine that the heads are missing, we'll have to issue `known` | |
|
319 | # request for them or one of their ancestors. This amount of `known` | |
|
320 | # request will likely be in the same order of magnitude than the amount | |
|
321 | # of local heads. | |
|
322 | # | |
|
323 | # The only case where we can be more efficient using `known` request on | |
|
324 | # ancestors are case were all the "missing" local heads are based on a | |
|
325 | # few changeset, also "missing". This means we would have a "complex" | |
|
326 | # graph (with many heads) attached to, but very independant to a the | |
|
327 | # "simple" graph on the server. This is a fairly usual case and have | |
|
328 | # not been met in the wild so far. | |
|
329 | if remote.limitedarguments: | |
|
278 | 330 | sample = _limitsample(ownheads, initialsamplesize) |
|
279 | 331 | # indices between sample and externalized version must match |
|
280 | 332 | sample = list(sample) |
|
333 | else: | |
|
334 | sample = ownheads | |
|
281 | 335 | |
|
282 | 336 | with remote.commandexecutor() as e: |
|
283 | 337 | fheads = e.callcommand('heads', {}) |
@@ -926,7 +926,7 b' Both many new on top of long history:' | |||
|
926 | 926 | common heads: 7ead0cba2838 |
|
927 | 927 | |
|
928 | 928 | |
|
929 | One with >200 heads, which used to use up all of the sample: | |
|
929 | One with >200 heads. We now switch to send them all in the initial roundtrip, but still do sampling for the later request. | |
|
930 | 930 | |
|
931 | 931 |
$ |
|
932 | 932 | $ cd manyheads |
@@ -974,20 +974,17 b' One with >200 heads, which used to use u' | |||
|
974 | 974 | searching for changes |
|
975 | 975 | taking quick initial sample |
|
976 | 976 | searching: 2 queries |
|
977 |
query 2; still undecided: 1 |
|
|
977 | query 2; still undecided: 1080, sample size is: 100 | |
|
978 | 978 | sampling from both directions |
|
979 | 979 | searching: 3 queries |
|
980 |
query 3; still undecided: |
|
|
980 | query 3; still undecided: 980, sample size is: 200 | |
|
981 | 981 | sampling from both directions |
|
982 | 982 | searching: 4 queries |
|
983 | 983 | query 4; still undecided: \d+, sample size is: 200 (re) |
|
984 | 984 | sampling from both directions |
|
985 | 985 | searching: 5 queries |
|
986 |
query 5; still undecided: |
|
|
987 | sampling from both directions | |
|
988 | searching: 6 queries | |
|
989 | query 6; still undecided: \d+, sample size is: \d+ (re) | |
|
990 | 6 total queries in *.????s (glob) | |
|
986 | query 5; still undecided: 195, sample size is: 195 | |
|
987 | 5 total queries in *.????s (glob) | |
|
991 | 988 | elapsed time: * seconds (glob) |
|
992 | 989 | heads summary: |
|
993 | 990 | total common heads: 1 |
@@ -1116,6 +1113,6 b' fixed in 86c35b7ae300:' | |||
|
1116 | 1113 | $ hg -R r1 --config extensions.blackbox= blackbox --config blackbox.track= |
|
1117 | 1114 | * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> serve --cmdserver chgunix * (glob) (chg !) |
|
1118 | 1115 | * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> -R r1 outgoing r2 *-T{rev} * --config *extensions.blackbox=* (glob) |
|
1119 |
* @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> found 101 common and 1 unknown server heads, |
|
|
1116 | * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> found 101 common and 1 unknown server heads, 1 roundtrips in *.????s (glob) | |
|
1120 | 1117 | * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> -R r1 outgoing r2 *-T{rev} * --config *extensions.blackbox=* exited 0 after *.?? seconds (glob) |
|
1121 | 1118 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now