diff mercurial/setdiscovery.py @ 32768:483d47753726

setdiscovery: improves logged message The 'srvheads' list contains all server heads including the common ones. We adjust 'ui.log' message to provide more useful information about server heads locally unknown. The performance impact of turning the list to set is negligible (about 1e-4s) compared to the rest of the discovery cost, so I'm taking the easy path.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 10 Jun 2017 18:47:09 +0100
parents 28240b75e880
children f77121b6bf1b
line wrap: on
line diff
--- a/mercurial/setdiscovery.py	Sat Jun 10 10:46:06 2017 -0400
+++ b/mercurial/setdiscovery.py	Sat Jun 10 18:47:09 2017 +0100
@@ -241,8 +241,10 @@
     elapsed = util.timer() - start
     ui.progress(_('searching'), None)
     ui.debug("%d total queries in %.4fs\n" % (roundtrips, elapsed))
-    msg = 'found %d common and %d missing heads, %d roundtrips in %.4fs\n'
-    ui.log('discovery', msg, len(result), len(srvheadhashes), roundtrips,
+    msg = ('found %d common and %d unknown server heads,'
+           ' %d roundtrips in %.4fs\n')
+    missing = set(result) - set(srvheads)
+    ui.log('discovery', msg, len(result), len(missing), roundtrips,
            elapsed)
 
     if not result and srvheadhashes != [nullid]: