Debian Codegraph @

tests/test-setdiscovery.t

raw
1
2 Function to test discovery between two repos in both directions, using both the local shortcut
3 (which is currently not activated by default) and the full remotable protocol:
4
5 $ testdesc() { # revs_a, revs_b, dagdesc
6 > if [ -d foo ]; then rm -rf foo; fi
7 > hg init foo
8 > cd foo
9 > hg debugbuilddag "$3"
10 > hg clone . a $1 --quiet
11 > hg clone . b $2 --quiet
12 > echo
13 > echo "% -- a -> b tree"
14 > hg -R a debugdiscovery b --verbose --old
15 > echo
16 > echo "% -- a -> b set"
17 > hg -R a debugdiscovery b --verbose --debug --config progress.debug=true
18 > echo
19 > echo "% -- a -> b set (tip only)"
20 > hg -R a debugdiscovery b --verbose --debug --config progress.debug=true --rev tip
21 > echo
22 > echo "% -- b -> a tree"
23 > hg -R b debugdiscovery a --verbose --old
24 > echo
25 > echo "% -- b -> a set"
26 > hg -R b debugdiscovery a --verbose --debug --config progress.debug=true
27 > echo
28 > echo "% -- b -> a set (tip only)"
29 > hg -R b debugdiscovery a --verbose --debug --config progress.debug=true --rev tip
30 > cd ..
31 > }
32
33
34 Small superset:
35
36 $ testdesc '-ra1 -ra2' '-rb1 -rb2 -rb3' '
37 > +2:f +1:a1:b1
38 > <f +4 :a2
39 > +5 :b2
40 > <f +3 :b3'
41
42 % -- a -> b tree
43 comparing with b
44 searching for changes
45 unpruned common: 01241442b3c2 66f7d451a68b b5714e113bc0
46 elapsed time: * seconds (glob)
47 round-trips: 4
48 queries: 6
49 queries-branches: 2
50 queries-between: 4
51 heads summary:
52 total common heads: 2
53 also local heads: 2
54 also remote heads: 1
55 both: 1
56 local heads: 2
57 common: 2
58 missing: 0
59 remote heads: 3
60 common: 1
61 unknown: 2
62 local changesets: 7
63 common: 7
64 heads: 2
65 roots: 1
66 missing: 0
67 heads: 0
68 roots: 0
69 first undecided set: 3
70 heads: 1
71 roots: 1
72 common: 3
73 missing: 0
74 common heads: 01241442b3c2 b5714e113bc0
75
76 % -- a -> b set
77 comparing with b
78 query 1; heads
79 searching for changes
80 all local changesets known remotely
81 elapsed time: * seconds (glob)
82 round-trips: 1
83 queries: 2
84 heads summary:
85 total common heads: 2
86 also local heads: 2
87 also remote heads: 1
88 both: 1
89 local heads: 2
90 common: 2
91 missing: 0
92 remote heads: 3
93 common: 1
94 unknown: 2
95 local changesets: 7
96 common: 7
97 heads: 2
98 roots: 1
99 missing: 0
100 heads: 0
101 roots: 0
102 first undecided set: 3
103 heads: 1
104 roots: 1
105 common: 3
106 missing: 0
107 common heads: 01241442b3c2 b5714e113bc0
108
109 % -- a -> b set (tip only)
110 comparing with b
111 query 1; heads
112 searching for changes
113 all local changesets known remotely
114 elapsed time: * seconds (glob)
115 round-trips: 1
116 queries: 1
117 heads summary:
118 total common heads: 1
119 also local heads: 1
120 also remote heads: 0
121 both: 0
122 local heads: 2
123 common: 1
124 missing: 1
125 remote heads: 3
126 common: 0
127 unknown: 3
128 local changesets: 7
129 common: 6
130 heads: 1
131 roots: 1
132 missing: 1
133 heads: 1
134 roots: 1
135 first undecided set: 6
136 heads: 2
137 roots: 1
138 common: 5
139 missing: 1
140 common heads: b5714e113bc0
141
142 % -- b -> a tree
143 comparing with a
144 searching for changes
145 unpruned common: 01241442b3c2 b5714e113bc0
146 elapsed time: * seconds (glob)
147 round-trips: 1
148 queries: 0
149 queries-branches: 0
150 queries-between: 0
151 heads summary:
152 total common heads: 2
153 also local heads: 1
154 also remote heads: 2
155 both: 1
156 local heads: 3
157 common: 1
158 missing: 2
159 remote heads: 2
160 common: 2
161 unknown: 0
162 local changesets: 15
163 common: 7
164 heads: 2
165 roots: 1
166 missing: 8
167 heads: 2
168 roots: 2
169 first undecided set: 8
170 heads: 2
171 roots: 2
172 common: 0
173 missing: 8
174 common heads: 01241442b3c2 b5714e113bc0
175
176 % -- b -> a set
177 comparing with a
178 query 1; heads
179 searching for changes
180 all remote heads known locally
181 elapsed time: * seconds (glob)
182 round-trips: 1
183 queries: 3
184 heads summary:
185 total common heads: 2
186 also local heads: 1
187 also remote heads: 2
188 both: 1
189 local heads: 3
190 common: 1
191 missing: 2
192 remote heads: 2
193 common: 2
194 unknown: 0
195 local changesets: 15
196 common: 7
197 heads: 2
198 roots: 1
199 missing: 8
200 heads: 2
201 roots: 2
202 first undecided set: 8
203 heads: 2
204 roots: 2
205 common: 0
206 missing: 8
207 common heads: 01241442b3c2 b5714e113bc0
208
209 % -- b -> a set (tip only)
210 comparing with a
211 query 1; heads
212 searching for changes
213 all remote heads known locally
214 elapsed time: * seconds (glob)
215 round-trips: 1
216 queries: 1
217 heads summary:
218 total common heads: 2
219 also local heads: 1
220 also remote heads: 2
221 both: 1
222 local heads: 3
223 common: 1
224 missing: 2
225 remote heads: 2
226 common: 2
227 unknown: 0
228 local changesets: 15
229 common: 7
230 heads: 2
231 roots: 1
232 missing: 8
233 heads: 2
234 roots: 2
235 first undecided set: 8
236 heads: 2
237 roots: 2
238 common: 0
239 missing: 8
240 common heads: 01241442b3c2 b5714e113bc0
241
242
243 Many new:
244
245 $ testdesc '-ra1 -ra2' '-rb' '
246 > +2:f +3:a1 +3:b
247 > <f +30 :a2'
248
249 % -- a -> b tree
250 comparing with b
251 searching for changes
252 unpruned common: bebd167eb94d
253 elapsed time: * seconds (glob)
254 round-trips: 4
255 queries: 3
256 queries-branches: 1
257 queries-between: 2
258 heads summary:
259 total common heads: 1
260 also local heads: 1
261 also remote heads: 0
262 both: 0
263 local heads: 2
264 common: 1
265 missing: 1
266 remote heads: 1
267 common: 0
268 unknown: 1
269 local changesets: 35
270 common: 5
271 heads: 1
272 roots: 1
273 missing: 30
274 heads: 1
275 roots: 1
276 first undecided set: 34
277 heads: 2
278 roots: 1
279 common: 4
280 missing: 30
281 common heads: bebd167eb94d
282
283 % -- a -> b set
284 comparing with b
285 query 1; heads
286 searching for changes
287 taking initial sample
288 searching: 2 queries
289 query 2; still undecided: 29, sample size is: 29
290 2 total queries in *.????s (glob)
291 elapsed time: * seconds (glob)
292 round-trips: 2
293 queries: 31
294 heads summary:
295 total common heads: 1
296 also local heads: 1
297 also remote heads: 0
298 both: 0
299 local heads: 2
300 common: 1
301 missing: 1
302 remote heads: 1
303 common: 0
304 unknown: 1
305 local changesets: 35
306 common: 5
307 heads: 1
308 roots: 1
309 missing: 30
310 heads: 1
311 roots: 1
312 first undecided set: 34
313 heads: 2
314 roots: 1
315 common: 4
316 missing: 30
317 common heads: bebd167eb94d
318
319 % -- a -> b set (tip only)
320 comparing with b
321 query 1; heads
322 searching for changes
323 taking quick initial sample
324 searching: 2 queries
325 query 2; still undecided: 31, sample size is: 31
326 2 total queries in *.????s (glob)
327 elapsed time: * seconds (glob)
328 round-trips: 2
329 queries: 32
330 heads summary:
331 total common heads: 1
332 also local heads: 0
333 also remote heads: 0
334 both: 0
335 local heads: 2
336 common: 0
337 missing: 2
338 remote heads: 1
339 common: 0
340 unknown: 1
341 local changesets: 35
342 common: 2
343 heads: 1
344 roots: 1
345 missing: 33
346 heads: 2
347 roots: 2
348 first undecided set: 35
349 heads: 2
350 roots: 1
351 common: 2
352 missing: 33
353 common heads: 66f7d451a68b
354
355 % -- b -> a tree
356 comparing with a
357 searching for changes
358 unpruned common: 66f7d451a68b bebd167eb94d
359 elapsed time: * seconds (glob)
360 round-trips: 6
361 queries: 5
362 queries-branches: 1
363 queries-between: 4
364 heads summary:
365 total common heads: 1
366 also local heads: 0
367 also remote heads: 1
368 both: 0
369 local heads: 1
370 common: 0
371 missing: 1
372 remote heads: 2
373 common: 1
374 unknown: 1
375 local changesets: 8
376 common: 5
377 heads: 1
378 roots: 1
379 missing: 3
380 heads: 1
381 roots: 1
382 first undecided set: 3
383 heads: 1
384 roots: 1
385 common: 0
386 missing: 3
387 common heads: bebd167eb94d
388
389 % -- b -> a set
390 comparing with a
391 query 1; heads
392 searching for changes
393 taking initial sample
394 searching: 2 queries
395 query 2; still undecided: 2, sample size is: 2
396 2 total queries in *.????s (glob)
397 elapsed time: * seconds (glob)
398 round-trips: 2
399 queries: 3
400 heads summary:
401 total common heads: 1
402 also local heads: 0
403 also remote heads: 1
404 both: 0
405 local heads: 1
406 common: 0
407 missing: 1
408 remote heads: 2
409 common: 1
410 unknown: 1
411 local changesets: 8
412 common: 5
413 heads: 1
414 roots: 1
415 missing: 3
416 heads: 1
417 roots: 1
418 first undecided set: 3
419 heads: 1
420 roots: 1
421 common: 0
422 missing: 3
423 common heads: bebd167eb94d
424
425 % -- b -> a set (tip only)
426 comparing with a
427 query 1; heads
428 searching for changes
429 taking initial sample
430 searching: 2 queries
431 query 2; still undecided: 2, sample size is: 2
432 2 total queries in *.????s (glob)
433 elapsed time: * seconds (glob)
434 round-trips: 2
435 queries: 3
436 heads summary:
437 total common heads: 1
438 also local heads: 0
439 also remote heads: 1
440 both: 0
441 local heads: 1
442 common: 0
443 missing: 1
444 remote heads: 2
445 common: 1
446 unknown: 1
447 local changesets: 8
448 common: 5
449 heads: 1
450 roots: 1
451 missing: 3
452 heads: 1
453 roots: 1
454 first undecided set: 3
455 heads: 1
456 roots: 1
457 common: 0
458 missing: 3
459 common heads: bebd167eb94d
460
461 Both sides many new with stub:
462
463 $ testdesc '-ra1 -ra2' '-rb' '
464 > +2:f +2:a1 +30 :b
465 > <f +30 :a2'
466
467 % -- a -> b tree
468 comparing with b
469 searching for changes
470 unpruned common: 2dc09a01254d
471 elapsed time: * seconds (glob)
472 round-trips: 6
473 queries: 5
474 queries-branches: 1
475 queries-between: 4
476 heads summary:
477 total common heads: 1
478 also local heads: 1
479 also remote heads: 0
480 both: 0
481 local heads: 2
482 common: 1
483 missing: 1
484 remote heads: 1
485 common: 0
486 unknown: 1
487 local changesets: 34
488 common: 4
489 heads: 1
490 roots: 1
491 missing: 30
492 heads: 1
493 roots: 1
494 first undecided set: 33
495 heads: 2
496 roots: 1
497 common: 3
498 missing: 30
499 common heads: 2dc09a01254d
500
501 % -- a -> b set
502 comparing with b
503 query 1; heads
504 searching for changes
505 taking initial sample
506 searching: 2 queries
507 query 2; still undecided: 29, sample size is: 29
508 2 total queries in *.????s (glob)
509 elapsed time: * seconds (glob)
510 round-trips: 2
511 queries: 31
512 heads summary:
513 total common heads: 1
514 also local heads: 1
515 also remote heads: 0
516 both: 0
517 local heads: 2
518 common: 1
519 missing: 1
520 remote heads: 1
521 common: 0
522 unknown: 1
523 local changesets: 34
524 common: 4
525 heads: 1
526 roots: 1
527 missing: 30
528 heads: 1
529 roots: 1
530 first undecided set: 33
531 heads: 2
532 roots: 1
533 common: 3
534 missing: 30
535 common heads: 2dc09a01254d
536
537 % -- a -> b set (tip only)
538 comparing with b
539 query 1; heads
540 searching for changes
541 taking quick initial sample
542 searching: 2 queries
543 query 2; still undecided: 31, sample size is: 31
544 2 total queries in *.????s (glob)
545 elapsed time: * seconds (glob)
546 round-trips: 2
547 queries: 32
548 heads summary:
549 total common heads: 1
550 also local heads: 0
551 also remote heads: 0
552 both: 0
553 local heads: 2
554 common: 0
555 missing: 2
556 remote heads: 1
557 common: 0
558 unknown: 1
559 local changesets: 34
560 common: 2
561 heads: 1
562 roots: 1
563 missing: 32
564 heads: 2
565 roots: 2
566 first undecided set: 34
567 heads: 2
568 roots: 1
569 common: 2
570 missing: 32
571 common heads: 66f7d451a68b
572
573 % -- b -> a tree
574 comparing with a
575 searching for changes
576 unpruned common: 2dc09a01254d 66f7d451a68b
577 elapsed time: * seconds (glob)
578 round-trips: 6
579 queries: 5
580 queries-branches: 1
581 queries-between: 4
582 heads summary:
583 total common heads: 1
584 also local heads: 0
585 also remote heads: 1
586 both: 0
587 local heads: 1
588 common: 0
589 missing: 1
590 remote heads: 2
591 common: 1
592 unknown: 1
593 local changesets: 34
594 common: 4
595 heads: 1
596 roots: 1
597 missing: 30
598 heads: 1
599 roots: 1
600 first undecided set: 30
601 heads: 1
602 roots: 1
603 common: 0
604 missing: 30
605 common heads: 2dc09a01254d
606
607 % -- b -> a set
608 comparing with a
609 query 1; heads
610 searching for changes
611 taking initial sample
612 searching: 2 queries
613 query 2; still undecided: 29, sample size is: 29
614 2 total queries in *.????s (glob)
615 elapsed time: * seconds (glob)
616 round-trips: 2
617 queries: 30
618 heads summary:
619 total common heads: 1
620 also local heads: 0
621 also remote heads: 1
622 both: 0
623 local heads: 1
624 common: 0
625 missing: 1
626 remote heads: 2
627 common: 1
628 unknown: 1
629 local changesets: 34
630 common: 4
631 heads: 1
632 roots: 1
633 missing: 30
634 heads: 1
635 roots: 1
636 first undecided set: 30
637 heads: 1
638 roots: 1
639 common: 0
640 missing: 30
641 common heads: 2dc09a01254d
642
643 % -- b -> a set (tip only)
644 comparing with a
645 query 1; heads
646 searching for changes
647 taking initial sample
648 searching: 2 queries
649 query 2; still undecided: 29, sample size is: 29
650 2 total queries in *.????s (glob)
651 elapsed time: * seconds (glob)
652 round-trips: 2
653 queries: 30
654 heads summary:
655 total common heads: 1
656 also local heads: 0
657 also remote heads: 1
658 both: 0
659 local heads: 1
660 common: 0
661 missing: 1
662 remote heads: 2
663 common: 1
664 unknown: 1
665 local changesets: 34
666 common: 4
667 heads: 1
668 roots: 1
669 missing: 30
670 heads: 1
671 roots: 1
672 first undecided set: 30
673 heads: 1
674 roots: 1
675 common: 0
676 missing: 30
677 common heads: 2dc09a01254d
678
679
680 Both many new:
681
682 $ testdesc '-ra' '-rb' '
683 > +2:f +30 :b
684 > <f +30 :a'
685
686 % -- a -> b tree
687 comparing with b
688 searching for changes
689 unpruned common: 66f7d451a68b
690 elapsed time: * seconds (glob)
691 round-trips: 6
692 queries: 5
693 queries-branches: 1
694 queries-between: 4
695 heads summary:
696 total common heads: 1
697 also local heads: 0
698 also remote heads: 0
699 both: 0
700 local heads: 1
701 common: 0
702 missing: 1
703 remote heads: 1
704 common: 0
705 unknown: 1
706 local changesets: 32
707 common: 2
708 heads: 1
709 roots: 1
710 missing: 30
711 heads: 1
712 roots: 1
713 first undecided set: 32
714 heads: 1
715 roots: 1
716 common: 2
717 missing: 30
718 common heads: 66f7d451a68b
719
720 % -- a -> b set
721 comparing with b
722 query 1; heads
723 searching for changes
724 taking quick initial sample
725 searching: 2 queries
726 query 2; still undecided: 31, sample size is: 31
727 2 total queries in *.????s (glob)
728 elapsed time: * seconds (glob)
729 round-trips: 2
730 queries: 32
731 heads summary:
732 total common heads: 1
733 also local heads: 0
734 also remote heads: 0
735 both: 0
736 local heads: 1
737 common: 0
738 missing: 1
739 remote heads: 1
740 common: 0
741 unknown: 1
742 local changesets: 32
743 common: 2
744 heads: 1
745 roots: 1
746 missing: 30
747 heads: 1
748 roots: 1
749 first undecided set: 32
750 heads: 1
751 roots: 1
752 common: 2
753 missing: 30
754 common heads: 66f7d451a68b
755
756 % -- a -> b set (tip only)
757 comparing with b
758 query 1; heads
759 searching for changes
760 taking quick initial sample
761 searching: 2 queries
762 query 2; still undecided: 31, sample size is: 31
763 2 total queries in *.????s (glob)
764 elapsed time: * seconds (glob)
765 round-trips: 2
766 queries: 32
767 heads summary:
768 total common heads: 1
769 also local heads: 0
770 also remote heads: 0
771 both: 0
772 local heads: 1
773 common: 0
774 missing: 1
775 remote heads: 1
776 common: 0
777 unknown: 1
778 local changesets: 32
779 common: 2
780 heads: 1
781 roots: 1
782 missing: 30
783 heads: 1
784 roots: 1
785 first undecided set: 32
786 heads: 1
787 roots: 1
788 common: 2
789 missing: 30
790 common heads: 66f7d451a68b
791
792 % -- b -> a tree
793 comparing with a
794 searching for changes
795 unpruned common: 66f7d451a68b
796 elapsed time: * seconds (glob)
797 round-trips: 6
798 queries: 5
799 queries-branches: 1
800 queries-between: 4
801 heads summary:
802 total common heads: 1
803 also local heads: 0
804 also remote heads: 0
805 both: 0
806 local heads: 1
807 common: 0
808 missing: 1
809 remote heads: 1
810 common: 0
811 unknown: 1
812 local changesets: 32
813 common: 2
814 heads: 1
815 roots: 1
816 missing: 30
817 heads: 1
818 roots: 1
819 first undecided set: 32
820 heads: 1
821 roots: 1
822 common: 2
823 missing: 30
824 common heads: 66f7d451a68b
825
826 % -- b -> a set
827 comparing with a
828 query 1; heads
829 searching for changes
830 taking quick initial sample
831 searching: 2 queries
832 query 2; still undecided: 31, sample size is: 31
833 2 total queries in *.????s (glob)
834 elapsed time: * seconds (glob)
835 round-trips: 2
836 queries: 32
837 heads summary:
838 total common heads: 1
839 also local heads: 0
840 also remote heads: 0
841 both: 0
842 local heads: 1
843 common: 0
844 missing: 1
845 remote heads: 1
846 common: 0
847 unknown: 1
848 local changesets: 32
849 common: 2
850 heads: 1
851 roots: 1
852 missing: 30
853 heads: 1
854 roots: 1
855 first undecided set: 32
856 heads: 1
857 roots: 1
858 common: 2
859 missing: 30
860 common heads: 66f7d451a68b
861
862 % -- b -> a set (tip only)
863 comparing with a
864 query 1; heads
865 searching for changes
866 taking quick initial sample
867 searching: 2 queries
868 query 2; still undecided: 31, sample size is: 31
869 2 total queries in *.????s (glob)
870 elapsed time: * seconds (glob)
871 round-trips: 2
872 queries: 32
873 heads summary:
874 total common heads: 1
875 also local heads: 0
876 also remote heads: 0
877 both: 0
878 local heads: 1
879 common: 0
880 missing: 1
881 remote heads: 1
882 common: 0
883 unknown: 1
884 local changesets: 32
885 common: 2
886 heads: 1
887 roots: 1
888 missing: 30
889 heads: 1
890 roots: 1
891 first undecided set: 32
892 heads: 1
893 roots: 1
894 common: 2
895 missing: 30
896 common heads: 66f7d451a68b
897
898
899 Both many new skewed:
900
901 $ testdesc '-ra' '-rb' '
902 > +2:f +30 :b
903 > <f +50 :a'
904
905 % -- a -> b tree
906 comparing with b
907 searching for changes
908 unpruned common: 66f7d451a68b
909 elapsed time: * seconds (glob)
910 round-trips: 6
911 queries: 5
912 queries-branches: 1
913 queries-between: 4
914 heads summary:
915 total common heads: 1
916 also local heads: 0
917 also remote heads: 0
918 both: 0
919 local heads: 1
920 common: 0
921 missing: 1
922 remote heads: 1
923 common: 0
924 unknown: 1
925 local changesets: 52
926 common: 2
927 heads: 1
928 roots: 1
929 missing: 50
930 heads: 1
931 roots: 1
932 first undecided set: 52
933 heads: 1
934 roots: 1
935 common: 2
936 missing: 50
937 common heads: 66f7d451a68b
938
939 % -- a -> b set
940 comparing with b
941 query 1; heads
942 searching for changes
943 taking quick initial sample
944 searching: 2 queries
945 query 2; still undecided: 51, sample size is: 51
946 2 total queries in *.????s (glob)
947 elapsed time: * seconds (glob)
948 round-trips: 2
949 queries: 52
950 heads summary:
951 total common heads: 1
952 also local heads: 0
953 also remote heads: 0
954 both: 0
955 local heads: 1
956 common: 0
957 missing: 1
958 remote heads: 1
959 common: 0
960 unknown: 1
961 local changesets: 52
962 common: 2
963 heads: 1
964 roots: 1
965 missing: 50
966 heads: 1
967 roots: 1
968 first undecided set: 52
969 heads: 1
970 roots: 1
971 common: 2
972 missing: 50
973 common heads: 66f7d451a68b
974
975 % -- a -> b set (tip only)
976 comparing with b
977 query 1; heads
978 searching for changes
979 taking quick initial sample
980 searching: 2 queries
981 query 2; still undecided: 51, sample size is: 51
982 2 total queries in *.????s (glob)
983 elapsed time: * seconds (glob)
984 round-trips: 2
985 queries: 52
986 heads summary:
987 total common heads: 1
988 also local heads: 0
989 also remote heads: 0
990 both: 0
991 local heads: 1
992 common: 0
993 missing: 1
994 remote heads: 1
995 common: 0
996 unknown: 1
997 local changesets: 52
998 common: 2
999 heads: 1
1000 roots: 1
1001 missing: 50
1002 heads: 1
1003 roots: 1
1004 first undecided set: 52
1005 heads: 1
1006 roots: 1
1007 common: 2
1008 missing: 50
1009 common heads: 66f7d451a68b
1010
1011 % -- b -> a tree
1012 comparing with a
1013 searching for changes
1014 unpruned common: 66f7d451a68b
1015 elapsed time: * seconds (glob)
1016 round-trips: 5
1017 queries: 4
1018 queries-branches: 1
1019 queries-between: 3
1020 heads summary:
1021 total common heads: 1
1022 also local heads: 0
1023 also remote heads: 0
1024 both: 0
1025 local heads: 1
1026 common: 0
1027 missing: 1
1028 remote heads: 1
1029 common: 0
1030 unknown: 1
1031 local changesets: 32
1032 common: 2
1033 heads: 1
1034 roots: 1
1035 missing: 30
1036 heads: 1
1037 roots: 1
1038 first undecided set: 32
1039 heads: 1
1040 roots: 1
1041 common: 2
1042 missing: 30
1043 common heads: 66f7d451a68b
1044
1045 % -- b -> a set
1046 comparing with a
1047 query 1; heads
1048 searching for changes
1049 taking quick initial sample
1050 searching: 2 queries
1051 query 2; still undecided: 31, sample size is: 31
1052 2 total queries in *.????s (glob)
1053 elapsed time: * seconds (glob)
1054 round-trips: 2
1055 queries: 32
1056 heads summary:
1057 total common heads: 1
1058 also local heads: 0
1059 also remote heads: 0
1060 both: 0
1061 local heads: 1
1062 common: 0
1063 missing: 1
1064 remote heads: 1
1065 common: 0
1066 unknown: 1
1067 local changesets: 32
1068 common: 2
1069 heads: 1
1070 roots: 1
1071 missing: 30
1072 heads: 1
1073 roots: 1
1074 first undecided set: 32
1075 heads: 1
1076 roots: 1
1077 common: 2
1078 missing: 30
1079 common heads: 66f7d451a68b
1080
1081 % -- b -> a set (tip only)
1082 comparing with a
1083 query 1; heads
1084 searching for changes
1085 taking quick initial sample
1086 searching: 2 queries
1087 query 2; still undecided: 31, sample size is: 31
1088 2 total queries in *.????s (glob)
1089 elapsed time: * seconds (glob)
1090 round-trips: 2
1091 queries: 32
1092 heads summary:
1093 total common heads: 1
1094 also local heads: 0
1095 also remote heads: 0
1096 both: 0
1097 local heads: 1
1098 common: 0
1099 missing: 1
1100 remote heads: 1
1101 common: 0
1102 unknown: 1
1103 local changesets: 32
1104 common: 2
1105 heads: 1
1106 roots: 1
1107 missing: 30
1108 heads: 1
1109 roots: 1
1110 first undecided set: 32
1111 heads: 1
1112 roots: 1
1113 common: 2
1114 missing: 30
1115 common heads: 66f7d451a68b
1116
1117
1118 Both many new on top of long history:
1119
1120 $ testdesc '-ra' '-rb' '
1121 > +1000:f +30 :b
1122 > <f +50 :a'
1123
1124 % -- a -> b tree
1125 comparing with b
1126 searching for changes
1127 unpruned common: 7ead0cba2838
1128 elapsed time: * seconds (glob)
1129 round-trips: 6
1130 queries: 5
1131 queries-branches: 1
1132 queries-between: 4
1133 heads summary:
1134 total common heads: 1
1135 also local heads: 0
1136 also remote heads: 0
1137 both: 0
1138 local heads: 1
1139 common: 0
1140 missing: 1
1141 remote heads: 1
1142 common: 0
1143 unknown: 1
1144 local changesets: 1050
1145 common: 1000
1146 heads: 1
1147 roots: 1
1148 missing: 50
1149 heads: 1
1150 roots: 1
1151 first undecided set: 1050
1152 heads: 1
1153 roots: 1
1154 common: 1000
1155 missing: 50
1156 common heads: 7ead0cba2838
1157
1158 % -- a -> b set
1159 comparing with b
1160 query 1; heads
1161 searching for changes
1162 taking quick initial sample
1163 searching: 2 queries
1164 query 2; still undecided: 1049, sample size is: 11
1165 sampling from both directions
1166 searching: 3 queries
1167 query 3; still undecided: 31, sample size is: 31
1168 3 total queries in *.????s (glob)
1169 elapsed time: * seconds (glob)
1170 round-trips: 3
1171 queries: 43
1172 heads summary:
1173 total common heads: 1
1174 also local heads: 0
1175 also remote heads: 0
1176 both: 0
1177 local heads: 1
1178 common: 0
1179 missing: 1
1180 remote heads: 1
1181 common: 0
1182 unknown: 1
1183 local changesets: 1050
1184 common: 1000
1185 heads: 1
1186 roots: 1
1187 missing: 50
1188 heads: 1
1189 roots: 1
1190 first undecided set: 1050
1191 heads: 1
1192 roots: 1
1193 common: 1000
1194 missing: 50
1195 common heads: 7ead0cba2838
1196
1197 % -- a -> b set (tip only)
1198 comparing with b
1199 query 1; heads
1200 searching for changes
1201 taking quick initial sample
1202 searching: 2 queries
1203 query 2; still undecided: 1049, sample size is: 11
1204 sampling from both directions
1205 searching: 3 queries
1206 query 3; still undecided: 31, sample size is: 31
1207 3 total queries in *.????s (glob)
1208 elapsed time: * seconds (glob)
1209 round-trips: 3
1210 queries: 43
1211 heads summary:
1212 total common heads: 1
1213 also local heads: 0
1214 also remote heads: 0
1215 both: 0
1216 local heads: 1
1217 common: 0
1218 missing: 1
1219 remote heads: 1
1220 common: 0
1221 unknown: 1
1222 local changesets: 1050
1223 common: 1000
1224 heads: 1
1225 roots: 1
1226 missing: 50
1227 heads: 1
1228 roots: 1
1229 first undecided set: 1050
1230 heads: 1
1231 roots: 1
1232 common: 1000
1233 missing: 50
1234 common heads: 7ead0cba2838
1235
1236 % -- b -> a tree
1237 comparing with a
1238 searching for changes
1239 unpruned common: 7ead0cba2838
1240 elapsed time: * seconds (glob)
1241 round-trips: 5
1242 queries: 4
1243 queries-branches: 1
1244 queries-between: 3
1245 heads summary:
1246 total common heads: 1
1247 also local heads: 0
1248 also remote heads: 0
1249 both: 0
1250 local heads: 1
1251 common: 0
1252 missing: 1
1253 remote heads: 1
1254 common: 0
1255 unknown: 1
1256 local changesets: 1030
1257 common: 1000
1258 heads: 1
1259 roots: 1
1260 missing: 30
1261 heads: 1
1262 roots: 1
1263 first undecided set: 1030
1264 heads: 1
1265 roots: 1
1266 common: 1000
1267 missing: 30
1268 common heads: 7ead0cba2838
1269
1270 % -- b -> a set
1271 comparing with a
1272 query 1; heads
1273 searching for changes
1274 taking quick initial sample
1275 searching: 2 queries
1276 query 2; still undecided: 1029, sample size is: 11
1277 sampling from both directions
1278 searching: 3 queries
1279 query 3; still undecided: 15, sample size is: 15
1280 3 total queries in *.????s (glob)
1281 elapsed time: * seconds (glob)
1282 round-trips: 3
1283 queries: 27
1284 heads summary:
1285 total common heads: 1
1286 also local heads: 0
1287 also remote heads: 0
1288 both: 0
1289 local heads: 1
1290 common: 0
1291 missing: 1
1292 remote heads: 1
1293 common: 0
1294 unknown: 1
1295 local changesets: 1030
1296 common: 1000
1297 heads: 1
1298 roots: 1
1299 missing: 30
1300 heads: 1
1301 roots: 1
1302 first undecided set: 1030
1303 heads: 1
1304 roots: 1
1305 common: 1000
1306 missing: 30
1307 common heads: 7ead0cba2838
1308
1309 % -- b -> a set (tip only)
1310 comparing with a
1311 query 1; heads
1312 searching for changes
1313 taking quick initial sample
1314 searching: 2 queries
1315 query 2; still undecided: 1029, sample size is: 11
1316 sampling from both directions
1317 searching: 3 queries
1318 query 3; still undecided: 15, sample size is: 15
1319 3 total queries in *.????s (glob)
1320 elapsed time: * seconds (glob)
1321 round-trips: 3
1322 queries: 27
1323 heads summary:
1324 total common heads: 1
1325 also local heads: 0
1326 also remote heads: 0
1327 both: 0
1328 local heads: 1
1329 common: 0
1330 missing: 1
1331 remote heads: 1
1332 common: 0
1333 unknown: 1
1334 local changesets: 1030
1335 common: 1000
1336 heads: 1
1337 roots: 1
1338 missing: 30
1339 heads: 1
1340 roots: 1
1341 first undecided set: 1030
1342 heads: 1
1343 roots: 1
1344 common: 1000
1345 missing: 30
1346 common heads: 7ead0cba2838
1347
1348
1349 One with >200 heads. We now switch to send them all in the initial roundtrip, but still do sampling for the later request.
1350
1351 $ hg init manyheads
1352 $ cd manyheads
1353 $ echo "+300:r @a" >dagdesc
1354 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
1355 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
1356 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
1357 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
1358 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
1359 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
1360 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
1361 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
1362 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
1363 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
1364 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
1365 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
1366 $ echo "*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3 *r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3*r+3" >>dagdesc # 20 heads
1367 $ echo "@b *r+3" >>dagdesc # one more head
1368 $ hg debugbuilddag <dagdesc
1369 reading DAG from stdin
1370
1371 $ hg heads -t --template . | wc -c
1372 \s*261 (re)
1373
1374 $ hg clone -b a . a
1375 adding changesets
1376 adding manifests
1377 adding file changes
1378 added 1340 changesets with 0 changes to 0 files (+259 heads)
1379 new changesets 1ea73414a91b:1c51e2c80832
1380 updating to branch a
1381 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1382 $ hg clone -b b . b
1383 adding changesets
1384 adding manifests
1385 adding file changes
1386 added 304 changesets with 0 changes to 0 files
1387 new changesets 1ea73414a91b:513314ca8b3a
1388 updating to branch b
1389 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1390
1391 $ hg -R a debugdiscovery b --debug --verbose --config progress.debug=true --config devel.discovery.randomize=false --config devel.discovery.sample-size.initial=50
1392 comparing with b
1393 query 1; heads
1394 searching for changes
1395 taking quick initial sample
1396 searching: 2 queries
1397 query 2; still undecided: 1080, sample size is: 50
1398 sampling from both directions
1399 searching: 3 queries
1400 query 3; still undecided: 1030, sample size is: 200
1401 sampling from both directions
1402 searching: 4 queries
1403 query 4; still undecided: 547, sample size is: 210
1404 sampling from both directions
1405 searching: 5 queries
1406 query 5; still undecided: 336, sample size is: 220
1407 sampling from both directions
1408 searching: 6 queries
1409 query 6; still undecided: 114, sample size is: 114
1410 6 total queries in *.????s (glob)
1411 elapsed time: * seconds (glob)
1412 round-trips: 6
1413 queries: 1054
1414 heads summary:
1415 total common heads: 1
1416 also local heads: 0
1417 also remote heads: 0
1418 both: 0
1419 local heads: 260
1420 common: 0
1421 missing: 260
1422 remote heads: 1
1423 common: 0
1424 unknown: 1
1425 local changesets: 1340
1426 common: 300
1427 heads: 1
1428 roots: 1
1429 missing: 1040
1430 heads: 260
1431 roots: 260
1432 first undecided set: 1340
1433 heads: 260
1434 roots: 1
1435 common: 300
1436 missing: 1040
1437 common heads: 3ee37d65064a
1438 $ hg -R a debugdiscovery b --debug --verbose --config progress.debug=true --rev tip
1439 comparing with b
1440 query 1; heads
1441 searching for changes
1442 taking quick initial sample
1443 searching: 2 queries
1444 query 2; still undecided: 303, sample size is: 9
1445 sampling from both directions
1446 searching: 3 queries
1447 query 3; still undecided: 3, sample size is: 3
1448 3 total queries in *.????s (glob)
1449 elapsed time: * seconds (glob)
1450 round-trips: 3
1451 queries: 13
1452 heads summary:
1453 total common heads: 1
1454 also local heads: 0
1455 also remote heads: 0
1456 both: 0
1457 local heads: 260
1458 common: 0
1459 missing: 260
1460 remote heads: 1
1461 common: 0
1462 unknown: 1
1463 local changesets: 1340
1464 common: 300
1465 heads: 1
1466 roots: 1
1467 missing: 1040
1468 heads: 260
1469 roots: 260
1470 first undecided set: 1340
1471 heads: 260
1472 roots: 1
1473 common: 300
1474 missing: 1040
1475 common heads: 3ee37d65064a
1476
1477 $ hg -R a debugdiscovery b --debug --config devel.discovery.exchange-heads=false --config devel.discovery.randomize=false --config devel.discovery.grow-sample.rate=1.20 --config devel.discovery.sample-size=50
1478 comparing with b
1479 searching for changes
1480 sampling from both directions
1481 query 1; still undecided: 1340, sample size is: 50
1482 sampling from both directions
1483 query 2; still undecided: 995, sample size is: 60
1484 sampling from both directions
1485 query 3; still undecided: 913, sample size is: 72
1486 sampling from both directions
1487 query 4; still undecided: 816, sample size is: 204
1488 sampling from both directions
1489 query 5; still undecided: 612, sample size is: 153
1490 sampling from both directions
1491 query 6; still undecided: 456, sample size is: 123
1492 sampling from both directions
1493 query 7; still undecided: 332, sample size is: 147
1494 sampling from both directions
1495 query 8; still undecided: 184, sample size is: 176
1496 sampling from both directions
1497 query 9; still undecided: 8, sample size is: 8
1498 9 total queries in *s (glob)
1499 elapsed time: * seconds (glob)
1500 round-trips: 9
1501 queries: 993
1502 heads summary:
1503 total common heads: 1
1504 also local heads: 0
1505 also remote heads: 0
1506 both: 0
1507 local heads: 260
1508 common: 0
1509 missing: 260
1510 remote heads: 1
1511 common: 0
1512 unknown: 1
1513 local changesets: 1340
1514 common: 300
1515 heads: 1
1516 roots: 1
1517 missing: 1040
1518 heads: 260
1519 roots: 260
1520 first undecided set: 1340
1521 heads: 260
1522 roots: 1
1523 common: 300
1524 missing: 1040
1525 common heads: 3ee37d65064a
1526
1527 Test actual protocol when pulling one new head in addition to common heads
1528
1529 $ hg clone -U b c
1530 $ hg -R c id -ir tip
1531 513314ca8b3a
1532 $ hg -R c up -qr default
1533 $ touch c/f
1534 $ hg -R c ci -Aqm "extra head"
1535 $ hg -R c id -i
1536 e64a39e7da8b
1537
1538 Check discovery with a small sample-size when talking to an http server without
1539 query size restriction.
1540
1541 $ hg serve -R c -p $HGPORT -d --pid-file=hg.pid -E errors.log \
1542 > --config experimental.httppostargs=yes
1543 $ cat hg.pid >> $DAEMON_PIDS
1544 $ hg -R a debugdiscovery http://localhost:$HGPORT/ --debug \
1545 > --config devel.discovery.exchange-heads=false \
1546 > --config devel.discovery.randomize=false \
1547 > --config devel.discovery.grow-sample.rate=1.20 \
1548 > --config devel.discovery.grow-sample.dynamic=yes \
1549 > --config devel.discovery.sample-size=10
1550 using http://localhost:$HGPORT/
1551 sending capabilities command
1552 comparing with http://localhost:$HGPORT/
1553 sending heads command
1554 searching for changes
1555 sampling from both directions
1556 query 1; still undecided: 1340, sample size is: 10
1557 sending known command
1558 sending 415 bytes
1559 sampling from both directions
1560 query 2; still undecided: 1163, sample size is: 12
1561 sending known command
1562 sending 497 bytes
1563 sampling from both directions
1564 query 3; still undecided: 1039, sample size is: 14
1565 sending known command
1566 sending 579 bytes
1567 sampling from both directions
1568 query 4; still undecided: 1021, sample size is: 16
1569 sending known command
1570 sending 661 bytes
1571 sampling from both directions
1572 query 5; still undecided: 1000, sample size is: 250
1573 sending known command
1574 sending 10255 bytes
1575 sampling from both directions
1576 query 6; still undecided: 748, sample size is: 187
1577 sending known command
1578 sending 7672 bytes
1579 sampling from both directions
1580 query 7; still undecided: 560, sample size is: 140
1581 sending known command
1582 sending 5745 bytes
1583 sampling from both directions
1584 query 8; still undecided: 420, sample size is: 105
1585 sending known command
1586 sending 4310 bytes
1587 sampling from both directions
1588 query 9; still undecided: 312, sample size is: 78
1589 sending known command
1590 sending 3203 bytes
1591 sampling from both directions
1592 query 10; still undecided: 232, sample size is: 58
1593 sending known command
1594 sending 2383 bytes
1595 sampling from both directions
1596 query 11; still undecided: 172, sample size is: 52
1597 sending known command
1598 sending 2137 bytes
1599 sampling from both directions
1600 query 12; still undecided: 120, sample size is: 62
1601 sending known command
1602 sending 2547 bytes
1603 sampling from both directions
1604 query 13; still undecided: 56, sample size is: 56
1605 sending known command
1606 sending 2301 bytes
1607 13 total queries in *.????s (glob)
1608 elapsed time: *.?????? seconds (glob)
1609 round-trips: 13
1610 queries: 1040
1611 heads summary:
1612 total common heads: 1
1613 also local heads: 0
1614 also remote heads: 0
1615 both: 0
1616 local heads: 260
1617 common: 0
1618 missing: 260
1619 remote heads: 2
1620 common: 0
1621 unknown: 2
1622 local changesets: 1340
1623 common: 300
1624 heads: 1
1625 roots: 1
1626 missing: 1040
1627 heads: 260
1628 roots: 260
1629 first undecided set: 1340
1630 heads: 260
1631 roots: 1
1632 common: 300
1633 missing: 1040
1634 common heads: 3ee37d65064a
1635 $ $RUNTESTDIR/killdaemons.py
1636
1637 Check discovery with a small sample-size when talking to an http server with
1638 query size restriction. The dynamic sample size adaptation should not kick in,
1639 neither should the sample size grow with the number of queries.
1640
1641 $ hg serve -R c -p $HGPORT -d --pid-file=hg.pid -E errors.log \
1642 > --config experimental.httppostargs=no
1643 $ cat hg.pid >> $DAEMON_PIDS
1644 $ hg -R a debugdiscovery http://localhost:$HGPORT/ --debug \
1645 > --config devel.discovery.exchange-heads=false \
1646 > --config devel.discovery.randomize=false \
1647 > --config devel.discovery.grow-sample.rate=1.20 \
1648 > --config devel.discovery.grow-sample.dynamic=yes \
1649 > --config devel.discovery.sample-size=10
1650 using http://localhost:$HGPORT/
1651 sending capabilities command
1652 comparing with http://localhost:$HGPORT/
1653 sending heads command
1654 searching for changes
1655 sampling from both directions
1656 query 1; still undecided: 1340, sample size is: 10
1657 sending known command
1658 sampling from both directions
1659 query 2; still undecided: 1163, sample size is: 10
1660 sending known command
1661 sampling from both directions
1662 query 3; still undecided: 1043, sample size is: 10
1663 sending known command
1664 sampling from both directions
1665 query 4; still undecided: 1029, sample size is: 10
1666 sending known command
1667 sampling from both directions
1668 query 5; still undecided: 1016, sample size is: 10
1669 sending known command
1670 sampling from both directions
1671 query 6; still undecided: 1004, sample size is: 10
1672 sending known command
1673 sampling from both directions
1674 query 7; still undecided: 992, sample size is: 10
1675 sending known command
1676 sampling from both directions
1677 query 8; still undecided: 980, sample size is: 10
1678 sending known command
1679 sampling from both directions
1680 query 9; still undecided: 968, sample size is: 10
1681 sending known command
1682 sampling from both directions
1683 query 10; still undecided: 956, sample size is: 10
1684 sending known command
1685 sampling from both directions
1686 query 11; still undecided: 944, sample size is: 10
1687 sending known command
1688 sampling from both directions
1689 query 12; still undecided: 932, sample size is: 10
1690 sending known command
1691 sampling from both directions
1692 query 13; still undecided: 920, sample size is: 10
1693 sending known command
1694 sampling from both directions
1695 query 14; still undecided: 908, sample size is: 10
1696 sending known command
1697 sampling from both directions
1698 query 15; still undecided: 896, sample size is: 10
1699 sending known command
1700 sampling from both directions
1701 query 16; still undecided: 884, sample size is: 10
1702 sending known command
1703 sampling from both directions
1704 query 17; still undecided: 872, sample size is: 10
1705 sending known command
1706 sampling from both directions
1707 query 18; still undecided: 860, sample size is: 10
1708 sending known command
1709 sampling from both directions
1710 query 19; still undecided: 848, sample size is: 10
1711 sending known command
1712 sampling from both directions
1713 query 20; still undecided: 836, sample size is: 10
1714 sending known command
1715 sampling from both directions
1716 query 21; still undecided: 824, sample size is: 10
1717 sending known command
1718 sampling from both directions
1719 query 22; still undecided: 812, sample size is: 10
1720 sending known command
1721 sampling from both directions
1722 query 23; still undecided: 800, sample size is: 10
1723 sending known command
1724 sampling from both directions
1725 query 24; still undecided: 788, sample size is: 10
1726 sending known command
1727 sampling from both directions
1728 query 25; still undecided: 776, sample size is: 10
1729 sending known command
1730 sampling from both directions
1731 query 26; still undecided: 764, sample size is: 10
1732 sending known command
1733 sampling from both directions
1734 query 27; still undecided: 752, sample size is: 10
1735 sending known command
1736 sampling from both directions
1737 query 28; still undecided: 740, sample size is: 10
1738 sending known command
1739 sampling from both directions
1740 query 29; still undecided: 728, sample size is: 10
1741 sending known command
1742 sampling from both directions
1743 query 30; still undecided: 716, sample size is: 10
1744 sending known command
1745 sampling from both directions
1746 query 31; still undecided: 704, sample size is: 10
1747 sending known command
1748 sampling from both directions
1749 query 32; still undecided: 692, sample size is: 10
1750 sending known command
1751 sampling from both directions
1752 query 33; still undecided: 680, sample size is: 10
1753 sending known command
1754 sampling from both directions
1755 query 34; still undecided: 668, sample size is: 10
1756 sending known command
1757 sampling from both directions
1758 query 35; still undecided: 656, sample size is: 10
1759 sending known command
1760 sampling from both directions
1761 query 36; still undecided: 644, sample size is: 10
1762 sending known command
1763 sampling from both directions
1764 query 37; still undecided: 632, sample size is: 10
1765 sending known command
1766 sampling from both directions
1767 query 38; still undecided: 620, sample size is: 10
1768 sending known command
1769 sampling from both directions
1770 query 39; still undecided: 608, sample size is: 10
1771 sending known command
1772 sampling from both directions
1773 query 40; still undecided: 596, sample size is: 10
1774 sending known command
1775 sampling from both directions
1776 query 41; still undecided: 584, sample size is: 10
1777 sending known command
1778 sampling from both directions
1779 query 42; still undecided: 572, sample size is: 10
1780 sending known command
1781 sampling from both directions
1782 query 43; still undecided: 560, sample size is: 10
1783 sending known command
1784 sampling from both directions
1785 query 44; still undecided: 548, sample size is: 10
1786 sending known command
1787 sampling from both directions
1788 query 45; still undecided: 536, sample size is: 10
1789 sending known command
1790 sampling from both directions
1791 query 46; still undecided: 524, sample size is: 10
1792 sending known command
1793 sampling from both directions
1794 query 47; still undecided: 512, sample size is: 10
1795 sending known command
1796 sampling from both directions
1797 query 48; still undecided: 500, sample size is: 10
1798 sending known command
1799 sampling from both directions
1800 query 49; still undecided: 488, sample size is: 10
1801 sending known command
1802 sampling from both directions
1803 query 50; still undecided: 476, sample size is: 10
1804 sending known command
1805 sampling from both directions
1806 query 51; still undecided: 464, sample size is: 10
1807 sending known command
1808 sampling from both directions
1809 query 52; still undecided: 452, sample size is: 10
1810 sending known command
1811 sampling from both directions
1812 query 53; still undecided: 440, sample size is: 10
1813 sending known command
1814 sampling from both directions
1815 query 54; still undecided: 428, sample size is: 10
1816 sending known command
1817 sampling from both directions
1818 query 55; still undecided: 416, sample size is: 10
1819 sending known command
1820 sampling from both directions
1821 query 56; still undecided: 404, sample size is: 10
1822 sending known command
1823 sampling from both directions
1824 query 57; still undecided: 392, sample size is: 10
1825 sending known command
1826 sampling from both directions
1827 query 58; still undecided: 380, sample size is: 10
1828 sending known command
1829 sampling from both directions
1830 query 59; still undecided: 368, sample size is: 10
1831 sending known command
1832 sampling from both directions
1833 query 60; still undecided: 356, sample size is: 10
1834 sending known command
1835 sampling from both directions
1836 query 61; still undecided: 344, sample size is: 10
1837 sending known command
1838 sampling from both directions
1839 query 62; still undecided: 332, sample size is: 10
1840 sending known command
1841 sampling from both directions
1842 query 63; still undecided: 320, sample size is: 10
1843 sending known command
1844 sampling from both directions
1845 query 64; still undecided: 308, sample size is: 10
1846 sending known command
1847 sampling from both directions
1848 query 65; still undecided: 296, sample size is: 10
1849 sending known command
1850 sampling from both directions
1851 query 66; still undecided: 284, sample size is: 10
1852 sending known command
1853 sampling from both directions
1854 query 67; still undecided: 272, sample size is: 10
1855 sending known command
1856 sampling from both directions
1857 query 68; still undecided: 260, sample size is: 10
1858 sending known command
1859 sampling from both directions
1860 query 69; still undecided: 248, sample size is: 10
1861 sending known command
1862 sampling from both directions
1863 query 70; still undecided: 236, sample size is: 10
1864 sending known command
1865 sampling from both directions
1866 query 71; still undecided: 224, sample size is: 10
1867 sending known command
1868 sampling from both directions
1869 query 72; still undecided: 212, sample size is: 10
1870 sending known command
1871 sampling from both directions
1872 query 73; still undecided: 200, sample size is: 10
1873 sending known command
1874 sampling from both directions
1875 query 74; still undecided: 188, sample size is: 10
1876 sending known command
1877 sampling from both directions
1878 query 75; still undecided: 176, sample size is: 10
1879 sending known command
1880 sampling from both directions
1881 query 76; still undecided: 164, sample size is: 10
1882 sending known command
1883 sampling from both directions
1884 query 77; still undecided: 152, sample size is: 10
1885 sending known command
1886 sampling from both directions
1887 query 78; still undecided: 140, sample size is: 10
1888 sending known command
1889 sampling from both directions
1890 query 79; still undecided: 128, sample size is: 10
1891 sending known command
1892 sampling from both directions
1893 query 80; still undecided: 116, sample size is: 10
1894 sending known command
1895 sampling from both directions
1896 query 81; still undecided: 104, sample size is: 10
1897 sending known command
1898 sampling from both directions
1899 query 82; still undecided: 92, sample size is: 10
1900 sending known command
1901 sampling from both directions
1902 query 83; still undecided: 80, sample size is: 10
1903 sending known command
1904 sampling from both directions
1905 query 84; still undecided: 68, sample size is: 10
1906 sending known command
1907 sampling from both directions
1908 query 85; still undecided: 56, sample size is: 10
1909 sending known command
1910 sampling from both directions
1911 query 86; still undecided: 44, sample size is: 10
1912 sending known command
1913 sampling from both directions
1914 query 87; still undecided: 32, sample size is: 10
1915 sending known command
1916 sampling from both directions
1917 query 88; still undecided: 20, sample size is: 10
1918 sending known command
1919 sampling from both directions
1920 query 89; still undecided: 8, sample size is: 8
1921 sending known command
1922 89 total queries in *.????s (glob)
1923 elapsed time: *.?????? seconds (glob)
1924 round-trips: 89
1925 queries: 888
1926 heads summary:
1927 total common heads: 1
1928 also local heads: 0
1929 also remote heads: 0
1930 both: 0
1931 local heads: 260
1932 common: 0
1933 missing: 260
1934 remote heads: 2
1935 common: 0
1936 unknown: 2
1937 local changesets: 1340
1938 common: 300
1939 heads: 1
1940 roots: 1
1941 missing: 1040
1942 heads: 260
1943 roots: 260
1944 first undecided set: 1340
1945 heads: 260
1946 roots: 1
1947 common: 300
1948 missing: 1040
1949 common heads: 3ee37d65064a
1950 $ $RUNTESTDIR/killdaemons.py
1951
1952 $ hg serve -R c -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log
1953 $ cat hg.pid >> $DAEMON_PIDS
1954
1955 $ hg -R b incoming http://localhost:$HGPORT/ -T '{node|short}\n'
1956 comparing with http://localhost:$HGPORT/
1957 searching for changes
1958 e64a39e7da8b
1959
1960 $ killdaemons.py
1961 $ cut -d' ' -f6- access.log | grep -v cmd=known # cmd=known uses random sampling
1962 "GET /?cmd=capabilities HTTP/1.1" 200 -
1963 "GET /?cmd=batch HTTP/1.1" 200 - x-hgarg-1:cmds=heads+%3Bknown+nodes%3D513314ca8b3ae4dac8eec56966265b00fcf866db x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
1964 "GET /?cmd=getbundle HTTP/1.1" 200 - x-hgarg-1:$USUAL_BUNDLE_CAPS$&cg=1&common=513314ca8b3ae4dac8eec56966265b00fcf866db&heads=e64a39e7da8b0d54bc63e81169aff001c13b3477 x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
1965 "GET /?cmd=listkeys HTTP/1.1" 200 - x-hgarg-1:namespace=phases x-hgproto-1:0.1 0.2 comp=$USUAL_COMPRESSIONS$ partial-pull
1966 $ cat errors.log
1967
1968 $ cd ..
1969
1970
1971 Issue 4438 - test coverage for 3ef893520a85 issues.
1972
1973 $ mkdir issue4438
1974 $ cd issue4438
1975 #if false
1976 generate new bundles:
1977 $ hg init r1
1978 $ for i in `"$PYTHON" $TESTDIR/seq.py 101`; do hg -R r1 up -qr null && hg -R r1 branch -q b$i && hg -R r1 ci -qmb$i; done
1979 $ hg clone -q r1 r2
1980 $ for i in `"$PYTHON" $TESTDIR/seq.py 10`; do hg -R r1 up -qr null && hg -R r1 branch -q c$i && hg -R r1 ci -qmc$i; done
1981 $ hg -R r2 branch -q r2change && hg -R r2 ci -qmr2change
1982 $ hg -R r1 bundle -qa $TESTDIR/bundles/issue4438-r1.hg
1983 $ hg -R r2 bundle -qa $TESTDIR/bundles/issue4438-r2.hg
1984 #else
1985 use existing bundles:
1986 $ hg init r1
1987 $ hg -R r1 -q unbundle $TESTDIR/bundles/issue4438-r1.hg
1988 $ hg -R r1 -q up
1989 $ hg init r2
1990 $ hg -R r2 -q unbundle $TESTDIR/bundles/issue4438-r2.hg
1991 $ hg -R r2 -q up
1992 #endif
1993
1994 Set iteration order could cause wrong and unstable results - fixed in 73cfaa348650:
1995
1996 $ hg -R r1 outgoing r2 -T'{rev} '
1997 comparing with r2
1998 searching for changes
1999 101 102 103 104 105 106 107 108 109 110 (no-eol)
2000
2001 The case where all the 'initialsamplesize' samples already were common would
2002 give 'all remote heads known locally' without checking the remaining heads -
2003 fixed in 86c35b7ae300:
2004
2005 $ cat >> r1/.hg/hgrc << EOF
2006 > [devel]
2007 > discovery.randomize = False
2008 > EOF
2009
2010 $ hg -R r1 outgoing r2 -T'{rev} ' --config extensions.blackbox= \
2011 > --config blackbox.track='command commandfinish discovery'
2012 comparing with r2
2013 searching for changes
2014 101 102 103 104 105 106 107 108 109 110 (no-eol)
2015 $ hg -R r1 --config extensions.blackbox= blackbox --config blackbox.track=
2016 * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> serve --no-profile --cmdserver chgunix * (glob) (chg !)
2017 * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> -R r1 outgoing r2 *-T{rev} * --config *extensions.blackbox=* (glob)
2018 * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> found 101 common and 1 unknown server heads, 1 roundtrips in *.????s (glob)
2019 * @5d0b986a083e0d91f116de4691e2aaa54d5bbec0 (*)> -R r1 outgoing r2 *-T{rev} * --config *extensions.blackbox=* exited 0 after *.?? seconds (glob)
2020 $ cd ..
2021
2022 Even if the set of revs to discover is restricted, unrelated revs may be
2023 returned as common heads.
2024
2025 $ mkdir ancestorsof
2026 $ cd ancestorsof
2027 $ hg init a
2028 $ hg clone a b -q
2029 $ cd b
2030 $ hg debugbuilddag '.:root *root *root'
2031 $ hg log -G -T '{node|short}'
2032 o fa942426a6fd
2033 |
2034 | o 66f7d451a68b
2035 |/
2036 o 1ea73414a91b
2037
2038 $ hg push -r 66f7d451a68b -q
2039 $ hg debugdiscovery --verbose --rev fa942426a6fd
2040 comparing with $TESTTMP/ancestorsof/a
2041 searching for changes
2042 elapsed time: * seconds (glob)
2043 round-trips: 1
2044 queries: 1
2045 heads summary:
2046 total common heads: 1
2047 also local heads: 1
2048 also remote heads: 1
2049 both: 1
2050 local heads: 2
2051 common: 1
2052 missing: 1
2053 remote heads: 1
2054 common: 1
2055 unknown: 0
2056 local changesets: 3
2057 common: 2
2058 heads: 1
2059 roots: 1
2060 missing: 1
2061 heads: 1
2062 roots: 1
2063 first undecided set: 1
2064 heads: 1
2065 roots: 1
2066 common: 0
2067 missing: 1
2068 common heads: 66f7d451a68b
2069
2070 $ cd ..
2071
2072
2073 Test debuging discovery using different subset of the same repository
2074 =====================================================================
2075
2076 remote is a local subset
2077 ------------------------
2078
2079 remote will be last 25 heads of the local graph
2080
2081 $ cd $TESTTMP/manyheads
2082 $ hg -R a debugdiscovery \
2083 > --debug \
2084 > --remote-as-revs 'last(heads(all()), 25)' \
2085 > --config devel.discovery.randomize=false
2086 query 1; heads
2087 searching for changes
2088 all remote heads known locally
2089 elapsed time: * seconds (glob)
2090 round-trips: 1
2091 queries: 260
2092 heads summary:
2093 total common heads: 25
2094 also local heads: 25
2095 also remote heads: 25
2096 both: 25
2097 local heads: 260
2098 common: 25
2099 missing: 235
2100 remote heads: 25
2101 common: 25
2102 unknown: 0
2103 local changesets: 1340
2104 common: 400
2105 heads: 25
2106 roots: 1
2107 missing: 940
2108 heads: 235
2109 roots: 235
2110 first undecided set: 940
2111 heads: 235
2112 roots: 235
2113 common: 0
2114 missing: 940
2115 common heads: 0dfd965d91c6 0fe09b60448d 14a17233ce9d 175c0a3072cf 1c51e2c80832 1e51600e0698 24eb5f9bdbab 25ce09526613 36bd00abde57 426989fdefa0 596d87362679 5dd1039ea5c0 5ef24f022278 5f230dc19419 80b39998accb 88f40688ffb5 9e37ddf8c632 abf4d55b075e b2ce801fddfe b368b6ac3ce3 c959bf2e869c c9fba6ba4e2e d783207cf649 d9a51e256f21 e3717a4e3753
2116
2117 local is a local subset
2118 ------------------------
2119
2120 remote will be last 25 heads of the local graph
2121
2122 $ cd $TESTTMP/manyheads
2123 $ hg -R a debugdiscovery b \
2124 > --debug \
2125 > --local-as-revs 'first(heads(all()), 25)' \
2126 > --config devel.discovery.randomize=false
2127 comparing with b
2128 query 1; heads
2129 searching for changes
2130 taking quick initial sample
2131 query 2; still undecided: 375, sample size is: 81
2132 sampling from both directions
2133 query 3; still undecided: 3, sample size is: 3
2134 3 total queries *s (glob)
2135 elapsed time: * seconds (glob)
2136 round-trips: 3
2137 queries: 109
2138 heads summary:
2139 total common heads: 1
2140 also local heads: 0
2141 also remote heads: 0
2142 both: 0
2143 local heads: 25
2144 common: 0
2145 missing: 25
2146 remote heads: 1
2147 common: 0
2148 unknown: 1
2149 local changesets: 400
2150 common: 300
2151 heads: 1
2152 roots: 1
2153 missing: 100
2154 heads: 25
2155 roots: 25
2156 first undecided set: 400
2157 heads: 25
2158 roots: 1
2159 common: 300
2160 missing: 100
2161 common heads: 3ee37d65064a
2162
2163 both local and remove are subset
2164 ------------------------
2165
2166 remote will be last 25 heads of the local graph
2167
2168 $ cd $TESTTMP/manyheads
2169 $ hg -R a debugdiscovery \
2170 > --debug \
2171 > --local-as-revs 'first(heads(all()), 25)' \
2172 > --remote-as-revs 'last(heads(all()), 25)' \
2173 > --config devel.discovery.randomize=false
2174 query 1; heads
2175 searching for changes
2176 taking quick initial sample
2177 query 2; still undecided: 375, sample size is: 81
2178 sampling from both directions
2179 query 3; still undecided: 3, sample size is: 3
2180 3 total queries in *s (glob)
2181 elapsed time: * seconds (glob)
2182 round-trips: 3
2183 queries: 109
2184 heads summary:
2185 total common heads: 1
2186 also local heads: 0
2187 also remote heads: 0
2188 both: 0
2189 local heads: 25
2190 common: 0
2191 missing: 25
2192 remote heads: 25
2193 common: 0
2194 unknown: 25
2195 local changesets: 400
2196 common: 300
2197 heads: 1
2198 roots: 1
2199 missing: 100
2200 heads: 25
2201 roots: 25
2202 first undecided set: 400
2203 heads: 25
2204 roots: 1
2205 common: 300
2206 missing: 100
2207 common heads: 3ee37d65064a
2208
2209 Test -T json output
2210 -------------------
2211
2212 $ hg -R a debugdiscovery \
2213 > -T json \
2214 > --debug \
2215 > --local-as-revs 'first(heads(all()), 25)' \
2216 > --remote-as-revs 'last(heads(all()), 25)' \
2217 > --config devel.discovery.randomize=false
2218 [
2219 {
2220 "elapsed": *, (glob)
2221 "nb-common-heads": 1,
2222 "nb-common-heads-both": 0,
2223 "nb-common-heads-local": 0,
2224 "nb-common-heads-remote": 0,
2225 "nb-common-roots": 1,
2226 "nb-head-local": 25,
2227 "nb-head-local-missing": 25,
2228 "nb-head-remote": 25,
2229 "nb-head-remote-unknown": 25,
2230 "nb-ini_und": 400,
2231 "nb-ini_und-common": 300,
2232 "nb-ini_und-heads": 25,
2233 "nb-ini_und-missing": 100,
2234 "nb-ini_und-roots": 1,
2235 "nb-missing-heads": 25,
2236 "nb-missing-roots": 25,
2237 "nb-revs": 400,
2238 "nb-revs-common": 300,
2239 "nb-revs-missing": 100,
2240 "output": "query 1; heads\nsearching for changes\ntaking quick initial sample\nquery 2; still undecided: 375, sample size is: 81\nsampling from both directions\nquery 3; still undecided: 3, sample size is: 3\n3 total queries in *s\n", (glob)
2241 "total-queries": 109,
2242 "total-roundtrips": 3
2243 }
2244 ]