Patchwork D9529: debugdiscovery: add some data about the shapes of the sets

login
register
mail settings
Submitter phabricator
Date Dec. 6, 2020, 1:47 p.m.
Message ID <differential-rev-PHID-DREV-qwbnruimn4oji5tr5p6l-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47813/
State Superseded
Headers show

Comments

phabricator - Dec. 6, 2020, 1:47 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  We display the number of heads and roots or the common and missing set.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D9529

AFFECTED FILES
  mercurial/debugcommands.py

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -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(