debugdiscovery: include the number of heads in all sets
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 16 Apr 2019 15:50:20 +0200
changeset 42145 607a0de9bae3
parent 42144 013de80bf90e
child 42149 84b5ad5fc2aa
child 42150 770f5f586ae5
debugdiscovery: include the number of heads in all sets We already displayed information about heads of the common set that are either local or remote heads. We now also do so for heads of the common set that are both local and remote heads too. This is useful because various step in the set discovery algorithm have head specific optimizations.
mercurial/debugcommands.py
tests/test-setdiscovery.t
--- a/mercurial/debugcommands.py	Wed Apr 17 00:37:00 2019 +0200
+++ b/mercurial/debugcommands.py	Tue Apr 16 15:50:20 2019 +0200
@@ -829,6 +829,7 @@
     data['nb-common'] = len(common)
     data['nb-common-local'] = len(common & lheads)
     data['nb-common-remote'] = len(common & rheads)
+    data['nb-common-both'] = len(common & rheads & lheads)
     data['nb-local'] = len(lheads)
     data['nb-local-missing'] = data['nb-local'] - data['nb-common-local']
     data['nb-remote'] = len(rheads)
@@ -843,6 +844,7 @@
     ui.write(("  total common heads:  %(nb-common)9d\n") % data)
     ui.write(("    also local heads:  %(nb-common-local)9d\n") % data)
     ui.write(("    also remote heads: %(nb-common-remote)9d\n") % data)
+    ui.write(("    both:              %(nb-common-both)9d\n") % data)
     ui.write(("  local heads:         %(nb-local)9d\n") % data)
     ui.write(("    common:            %(nb-common-local)9d\n") % data)
     ui.write(("    missing:           %(nb-local-missing)9d\n") % data)
--- a/tests/test-setdiscovery.t	Wed Apr 17 00:37:00 2019 +0200
+++ b/tests/test-setdiscovery.t	Tue Apr 16 15:50:20 2019 +0200
@@ -48,6 +48,7 @@
     total common heads:          2
       also local heads:          2
       also remote heads:         1
+      both:                      1
     local heads:                 2
       common:                    2
       missing:                   0
@@ -69,6 +70,7 @@
     total common heads:          2
       also local heads:          2
       also remote heads:         1
+      both:                      1
     local heads:                 2
       common:                    2
       missing:                   0
@@ -90,6 +92,7 @@
     total common heads:          1
       also local heads:          1
       also remote heads:         0
+      both:                      0
     local heads:                 2
       common:                    1
       missing:                   1
@@ -110,6 +113,7 @@
     total common heads:          2
       also local heads:          1
       also remote heads:         2
+      both:                      1
     local heads:                 3
       common:                    1
       missing:                   2
@@ -131,6 +135,7 @@
     total common heads:          2
       also local heads:          1
       also remote heads:         2
+      both:                      1
     local heads:                 3
       common:                    1
       missing:                   2
@@ -152,6 +157,7 @@
     total common heads:          2
       also local heads:          1
       also remote heads:         2
+      both:                      1
     local heads:                 3
       common:                    1
       missing:                   2
@@ -179,6 +185,7 @@
     total common heads:          1
       also local heads:          1
       also remote heads:         0
+      both:                      0
     local heads:                 2
       common:                    1
       missing:                   1
@@ -203,6 +210,7 @@
     total common heads:          1
       also local heads:          1
       also remote heads:         0
+      both:                      0
     local heads:                 2
       common:                    1
       missing:                   1
@@ -227,6 +235,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 2
       common:                    0
       missing:                   2
@@ -247,6 +256,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         1
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -271,6 +281,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         1
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -295,6 +306,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         1
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -321,6 +333,7 @@
     total common heads:          1
       also local heads:          1
       also remote heads:         0
+      both:                      0
     local heads:                 2
       common:                    1
       missing:                   1
@@ -345,6 +358,7 @@
     total common heads:          1
       also local heads:          1
       also remote heads:         0
+      both:                      0
     local heads:                 2
       common:                    1
       missing:                   1
@@ -369,6 +383,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 2
       common:                    0
       missing:                   2
@@ -389,6 +404,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         1
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -413,6 +429,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         1
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -437,6 +454,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         1
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -464,6 +482,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -488,6 +507,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -512,6 +532,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -532,6 +553,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -556,6 +578,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -580,6 +603,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -607,6 +631,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -631,6 +656,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -655,6 +681,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -675,6 +702,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -699,6 +727,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -723,6 +752,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -750,6 +780,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -777,6 +808,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -804,6 +836,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -824,6 +857,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -851,6 +885,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -878,6 +913,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:                 1
       common:                    0
       missing:                   1
@@ -957,6 +993,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:               260
       common:                    0
       missing:                 260
@@ -983,6 +1020,7 @@
     total common heads:          1
       also local heads:          0
       also remote heads:         0
+      both:                      0
     local heads:               260
       common:                    0
       missing:                 260