From patchwork Tue Apr 16 17:24:07 2019
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [1,of,2] debugdiscovery: include the number of heads in all sets
From: Pierre-Yves David
X-Patchwork-Id: 39661
Message-Id: <017778a4463a8e6ecb4b.1555435447@nodosa.octopoid.net>
To: mercurial-devel@mercurial-scm.org
Date: Tue, 16 Apr 2019 19:24:07 +0200
# HG changeset patch
# User Pierre-Yves David
# Date 1555422620 -7200
# Tue Apr 16 15:50:20 2019 +0200
# Node ID 017778a4463a8e6ecb4b17cacf46a3ab27bdb239
# Parent 967c098eed3398d991cbd7f0d48636b575beb711
# EXP-Topic discovery-speedup
# Available At https://bitbucket.org/octobus/mercurial-devel/
# hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 017778a4463a
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.
diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -829,6 +829,7 @@ def debugdiscovery(ui, repo, remoteurl="
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 @@ def debugdiscovery(ui, repo, remoteurl="
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)
diff --git a/tests/test-setdiscovery.t b/tests/test-setdiscovery.t
--- a/tests/test-setdiscovery.t
+++ b/tests/test-setdiscovery.t
@@ -48,6 +48,7 @@ Small superset:
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 @@ Small superset:
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 @@ Small superset:
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 @@ Small superset:
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 @@ Small superset:
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 @@ Small superset:
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 @@ Many new:
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 @@ Many new:
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 @@ Many new:
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 @@ Many new:
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 @@ Many new:
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 @@ Many new:
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 @@ Both sides many new with stub:
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 @@ Both sides many new with stub:
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 @@ Both sides many new with stub:
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 @@ Both sides many new with stub:
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 @@ Both sides many new with stub:
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 @@ Both sides many new with stub:
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 @@ Both many new:
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 @@ Both many new:
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 @@ Both many new:
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 @@ Both many new:
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 @@ Both many new:
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 @@ Both many new:
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 @@ Both many new skewed:
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 @@ Both many new skewed:
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 @@ Both many new skewed:
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 @@ Both many new skewed:
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 @@ Both many new skewed:
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 @@ Both many new skewed:
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 @@ Both many new on top of long history:
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 @@ Both many new on top of long history:
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 @@ Both many new on top of long history:
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 @@ Both many new on top of long history:
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 @@ Both many new on top of long history:
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 @@ Both many new on top of long history:
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 @@ One with >200 heads, which used to use u
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 @@ One with >200 heads, which used to use u
total common heads: 1
also local heads: 0
also remote heads: 0
+ both: 0
local heads: 260
common: 0
missing: 260