# HG changeset patch # User Pierre-Yves David # Date 1607231955 -3600 # Node ID 3ca9d26c5984e13b48faab0c9f788eee41c6da13 # Parent 31ecf715efe265a4c03aa48f1b45a595e5a5f6a7 debugdiscovery: add some data about the shapes of the sets We display the number of heads and roots or the common and missing set. Differential Revision: https://phab.mercurial-scm.org/D9529 diff -r 31ecf715efe2 -r 3ca9d26c5984 mercurial/debugcommands.py --- a/mercurial/debugcommands.py Mon Dec 07 21:44:00 2020 -0500 +++ b/mercurial/debugcommands.py Sun Dec 06 06:19:15 2020 +0100 @@ -1028,7 +1028,10 @@ all = repo.revs(b'all()') common = repo.revs(b'::%ln', common) + roots_common = repo.revs(b'roots(::%ld)', common) missing = repo.revs(b'not ::%ld', common) + heads_missing = repo.revs(b'heads(%ld)', missing) + roots_missing = repo.revs(b'roots(%ld)', missing) assert len(common) + len(missing) == len(all) data = {} @@ -1037,6 +1040,7 @@ data[b'nb-common-heads-local'] = len(heads_common_local) data[b'nb-common-heads-remote'] = len(heads_common_remote) data[b'nb-common-heads-both'] = len(heads_common_both) + data[b'nb-common-roots'] = len(roots_common) data[b'nb-head-local'] = len(heads_local) data[b'nb-head-local-missing'] = len(heads_local) - len(heads_common_local) data[b'nb-head-remote'] = len(heads_remote) @@ -1046,6 +1050,8 @@ data[b'nb-revs'] = len(all) data[b'nb-revs-common'] = len(common) data[b'nb-revs-missing'] = len(missing) + data[b'nb-missing-heads'] = len(roots_missing) + data[b'nb-missing-roots'] = len(heads_missing) # display discovery summary ui.writenoi18n(b"elapsed time: %(elapsed)f seconds\n" % data) @@ -1074,7 +1080,11 @@ ) ui.writenoi18n(b"local changesets: %(nb-revs)9d\n" % data) ui.writenoi18n(b" common: %(nb-revs-common)9d\n" % data) + ui.writenoi18n(b" heads: %(nb-common-heads)9d\n" % data) + ui.writenoi18n(b" roots: %(nb-common-roots)9d\n" % data) ui.writenoi18n(b" missing: %(nb-revs-missing)9d\n" % data) + ui.writenoi18n(b" heads: %(nb-missing-heads)9d\n" % data) + ui.writenoi18n(b" roots: %(nb-missing-roots)9d\n" % data) if ui.verbose: ui.writenoi18n( diff -r 31ecf715efe2 -r 3ca9d26c5984 tests/test-setdiscovery.t --- a/tests/test-setdiscovery.t Mon Dec 07 21:44:00 2020 -0500 +++ b/tests/test-setdiscovery.t Sun Dec 06 06:19:15 2020 +0100 @@ -57,7 +57,11 @@ unknown: 2 local changesets: 7 common: 7 + heads: 2 + roots: 1 missing: 0 + heads: 0 + roots: 0 common heads: 01241442b3c2 b5714e113bc0 % -- a -> b set @@ -79,7 +83,11 @@ unknown: 2 local changesets: 7 common: 7 + heads: 2 + roots: 1 missing: 0 + heads: 0 + roots: 0 common heads: 01241442b3c2 b5714e113bc0 % -- a -> b set (tip only) @@ -101,7 +109,11 @@ unknown: 3 local changesets: 7 common: 6 + heads: 1 + roots: 1 missing: 1 + heads: 1 + roots: 1 common heads: b5714e113bc0 % -- b -> a tree @@ -122,7 +134,11 @@ unknown: 0 local changesets: 15 common: 7 + heads: 2 + roots: 1 missing: 8 + heads: 2 + roots: 2 common heads: 01241442b3c2 b5714e113bc0 % -- b -> a set @@ -144,7 +160,11 @@ unknown: 0 local changesets: 15 common: 7 + heads: 2 + roots: 1 missing: 8 + heads: 2 + roots: 2 common heads: 01241442b3c2 b5714e113bc0 % -- b -> a set (tip only) @@ -166,7 +186,11 @@ unknown: 0 local changesets: 15 common: 7 + heads: 2 + roots: 1 missing: 8 + heads: 2 + roots: 2 common heads: 01241442b3c2 b5714e113bc0 @@ -194,7 +218,11 @@ unknown: 1 local changesets: 35 common: 5 + heads: 1 + roots: 1 missing: 30 + heads: 1 + roots: 1 common heads: bebd167eb94d % -- a -> b set @@ -219,7 +247,11 @@ unknown: 1 local changesets: 35 common: 5 + heads: 1 + roots: 1 missing: 30 + heads: 1 + roots: 1 common heads: bebd167eb94d % -- a -> b set (tip only) @@ -244,7 +276,11 @@ unknown: 1 local changesets: 35 common: 2 + heads: 1 + roots: 1 missing: 33 + heads: 2 + roots: 2 common heads: 66f7d451a68b % -- b -> a tree @@ -265,7 +301,11 @@ unknown: 1 local changesets: 8 common: 5 + heads: 1 + roots: 1 missing: 3 + heads: 1 + roots: 1 common heads: bebd167eb94d % -- b -> a set @@ -290,7 +330,11 @@ unknown: 1 local changesets: 8 common: 5 + heads: 1 + roots: 1 missing: 3 + heads: 1 + roots: 1 common heads: bebd167eb94d % -- b -> a set (tip only) @@ -315,7 +359,11 @@ unknown: 1 local changesets: 8 common: 5 + heads: 1 + roots: 1 missing: 3 + heads: 1 + roots: 1 common heads: bebd167eb94d Both sides many new with stub: @@ -342,7 +390,11 @@ unknown: 1 local changesets: 34 common: 4 + heads: 1 + roots: 1 missing: 30 + heads: 1 + roots: 1 common heads: 2dc09a01254d % -- a -> b set @@ -367,7 +419,11 @@ unknown: 1 local changesets: 34 common: 4 + heads: 1 + roots: 1 missing: 30 + heads: 1 + roots: 1 common heads: 2dc09a01254d % -- a -> b set (tip only) @@ -392,7 +448,11 @@ unknown: 1 local changesets: 34 common: 2 + heads: 1 + roots: 1 missing: 32 + heads: 2 + roots: 2 common heads: 66f7d451a68b % -- b -> a tree @@ -413,7 +473,11 @@ unknown: 1 local changesets: 34 common: 4 + heads: 1 + roots: 1 missing: 30 + heads: 1 + roots: 1 common heads: 2dc09a01254d % -- b -> a set @@ -438,7 +502,11 @@ unknown: 1 local changesets: 34 common: 4 + heads: 1 + roots: 1 missing: 30 + heads: 1 + roots: 1 common heads: 2dc09a01254d % -- b -> a set (tip only) @@ -463,7 +531,11 @@ unknown: 1 local changesets: 34 common: 4 + heads: 1 + roots: 1 missing: 30 + heads: 1 + roots: 1 common heads: 2dc09a01254d @@ -491,7 +563,11 @@ unknown: 1 local changesets: 32 common: 2 + heads: 1 + roots: 1 missing: 30 + heads: 1 + roots: 1 common heads: 66f7d451a68b % -- a -> b set @@ -516,7 +592,11 @@ unknown: 1 local changesets: 32 common: 2 + heads: 1 + roots: 1 missing: 30 + heads: 1 + roots: 1 common heads: 66f7d451a68b % -- a -> b set (tip only) @@ -541,7 +621,11 @@ unknown: 1 local changesets: 32 common: 2 + heads: 1 + roots: 1 missing: 30 + heads: 1 + roots: 1 common heads: 66f7d451a68b % -- b -> a tree @@ -562,7 +646,11 @@ unknown: 1 local changesets: 32 common: 2 + heads: 1 + roots: 1 missing: 30 + heads: 1 + roots: 1 common heads: 66f7d451a68b % -- b -> a set @@ -587,7 +675,11 @@ unknown: 1 local changesets: 32 common: 2 + heads: 1 + roots: 1 missing: 30 + heads: 1 + roots: 1 common heads: 66f7d451a68b % -- b -> a set (tip only) @@ -612,7 +704,11 @@ unknown: 1 local changesets: 32 common: 2 + heads: 1 + roots: 1 missing: 30 + heads: 1 + roots: 1 common heads: 66f7d451a68b @@ -640,7 +736,11 @@ unknown: 1 local changesets: 52 common: 2 + heads: 1 + roots: 1 missing: 50 + heads: 1 + roots: 1 common heads: 66f7d451a68b % -- a -> b set @@ -665,7 +765,11 @@ unknown: 1 local changesets: 52 common: 2 + heads: 1 + roots: 1 missing: 50 + heads: 1 + roots: 1 common heads: 66f7d451a68b % -- a -> b set (tip only) @@ -690,7 +794,11 @@ unknown: 1 local changesets: 52 common: 2 + heads: 1 + roots: 1 missing: 50 + heads: 1 + roots: 1 common heads: 66f7d451a68b % -- b -> a tree @@ -711,7 +819,11 @@ unknown: 1 local changesets: 32 common: 2 + heads: 1 + roots: 1 missing: 30 + heads: 1 + roots: 1 common heads: 66f7d451a68b % -- b -> a set @@ -736,7 +848,11 @@ unknown: 1 local changesets: 32 common: 2 + heads: 1 + roots: 1 missing: 30 + heads: 1 + roots: 1 common heads: 66f7d451a68b % -- b -> a set (tip only) @@ -761,7 +877,11 @@ unknown: 1 local changesets: 32 common: 2 + heads: 1 + roots: 1 missing: 30 + heads: 1 + roots: 1 common heads: 66f7d451a68b @@ -789,7 +909,11 @@ unknown: 1 local changesets: 1050 common: 1000 + heads: 1 + roots: 1 missing: 50 + heads: 1 + roots: 1 common heads: 7ead0cba2838 % -- a -> b set @@ -817,7 +941,11 @@ unknown: 1 local changesets: 1050 common: 1000 + heads: 1 + roots: 1 missing: 50 + heads: 1 + roots: 1 common heads: 7ead0cba2838 % -- a -> b set (tip only) @@ -845,7 +973,11 @@ unknown: 1 local changesets: 1050 common: 1000 + heads: 1 + roots: 1 missing: 50 + heads: 1 + roots: 1 common heads: 7ead0cba2838 % -- b -> a tree @@ -866,7 +998,11 @@ unknown: 1 local changesets: 1030 common: 1000 + heads: 1 + roots: 1 missing: 30 + heads: 1 + roots: 1 common heads: 7ead0cba2838 % -- b -> a set @@ -894,7 +1030,11 @@ unknown: 1 local changesets: 1030 common: 1000 + heads: 1 + roots: 1 missing: 30 + heads: 1 + roots: 1 common heads: 7ead0cba2838 % -- b -> a set (tip only) @@ -922,7 +1062,11 @@ unknown: 1 local changesets: 1030 common: 1000 + heads: 1 + roots: 1 missing: 30 + heads: 1 + roots: 1 common heads: 7ead0cba2838 @@ -1002,7 +1146,11 @@ unknown: 1 local changesets: 1340 common: 300 + heads: 1 + roots: 1 missing: 1040 + heads: 260 + roots: 260 common heads: 3ee37d65064a $ hg -R a debugdiscovery b --debug --verbose --config progress.debug=true --rev tip comparing with b @@ -1029,7 +1177,11 @@ unknown: 1 local changesets: 1340 common: 300 + heads: 1 + roots: 1 missing: 1040 + heads: 260 + roots: 260 common heads: 3ee37d65064a Test actual protocol when pulling one new head in addition to common heads @@ -1147,5 +1299,9 @@ unknown: 0 local changesets: 3 common: 2 + heads: 1 + roots: 1 missing: 1 + heads: 1 + roots: 1 common heads: 66f7d451a68b