Patchwork [5,of,6,"V2] debugdiscovery: only list common heads on verbose

login
register
mail settings
Submitter Pierre-Yves David
Date March 27, 2019, 11:23 a.m.
Message ID <7cc0cbcbfc9fd26a1053.1553685793@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/39394/
State Accepted
Headers show

Comments

Pierre-Yves David - March 27, 2019, 11:23 a.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1553617614 -3600
#      Tue Mar 26 17:26:54 2019 +0100
# Node ID 7cc0cbcbfc9fd26a10533384ba1bd50c3e5e371f
# Parent  f4139bc0601f18619f45d65ff2a62dc9f00be6a7
# EXP-Topic debug-discovery
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 7cc0cbcbfc9f
debugdiscovery: only list common heads on verbose

The list of common heads is only part of the useful information. In addition on
repository with many heads, the information is very not helpful (just fill a
couple of screen with hash). As a result we hide it behind a --verbose flag.

Patch

diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py
--- a/mercurial/debugcommands.py
+++ b/mercurial/debugcommands.py
@@ -849,8 +849,9 @@  def debugdiscovery(ui, repo, remoteurl="
     ui.write(("  common:              %(nb-revs-common)9d\n") % data)
     ui.write(("  missing:             %(nb-revs-missing)9d\n") % data)
 
-    ui.write(("common heads: %s\n") %
-             " ".join(sorted(short(n) for n in common)))
+    if ui.verbose:
+        ui.write(("common heads: %s\n") %
+                 " ".join(sorted(short(n) for n in common)))
 
 _chunksize = 4 << 10