diff mercurial/debugcommands.py @ 46080:0e5065b6baa0

debugdiscovery: display some information about the initial "undecided" set The size and shape of the revision that remains "undediced" once the fetched the remote heads and queried the local one have a large impact on the discovery performance, so we display some information about that set. Differential Revision: https://phab.mercurial-scm.org/D9530
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 06 Dec 2020 14:45:19 +0100
parents 3ca9d26c5984
children d90f439ff19f
line wrap: on
line diff
--- a/mercurial/debugcommands.py	Sun Dec 06 06:19:15 2020 +0100
+++ b/mercurial/debugcommands.py	Sun Dec 06 14:45:19 2020 +0100
@@ -1034,6 +1034,14 @@
     roots_missing = repo.revs(b'roots(%ld)', missing)
     assert len(common) + len(missing) == len(all)
 
+    initial_undecided = repo.revs(
+        b'not (::%ln or %ln::)', heads_common_remote, heads_common_local
+    )
+    heads_initial_undecided = repo.revs(b'heads(%ld)', initial_undecided)
+    roots_initial_undecided = repo.revs(b'roots(%ld)', initial_undecided)
+    common_initial_undecided = initial_undecided & common
+    missing_initial_undecided = initial_undecided & missing
+
     data = {}
     data[b'elapsed'] = t.elapsed
     data[b'nb-common-heads'] = len(heads_common)
@@ -1052,6 +1060,11 @@
     data[b'nb-revs-missing'] = len(missing)
     data[b'nb-missing-heads'] = len(roots_missing)
     data[b'nb-missing-roots'] = len(heads_missing)
+    data[b'nb-ini_und'] = len(initial_undecided)
+    data[b'nb-ini_und-heads'] = len(heads_initial_undecided)
+    data[b'nb-ini_und-roots'] = len(roots_initial_undecided)
+    data[b'nb-ini_und-common'] = len(common_initial_undecided)
+    data[b'nb-ini_und-missing'] = len(missing_initial_undecided)
 
     # display discovery summary
     ui.writenoi18n(b"elapsed time:  %(elapsed)f seconds\n" % data)
@@ -1085,6 +1098,11 @@
     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)
+    ui.writenoi18n(b"  first undecided set: %(nb-ini_und)9d\n" % data)
+    ui.writenoi18n(b"    heads:             %(nb-ini_und-heads)9d\n" % data)
+    ui.writenoi18n(b"    roots:             %(nb-ini_und-roots)9d\n" % data)
+    ui.writenoi18n(b"    common:            %(nb-ini_und-common)9d\n" % data)
+    ui.writenoi18n(b"    missing:           %(nb-ini_und-missing)9d\n" % data)
 
     if ui.verbose:
         ui.writenoi18n(