mercurial/debugcommands.py
changeset 42035 eec20025ada3
parent 42034 fd8d13ea1bcc
child 42041 3e47d1ec9da5
--- a/mercurial/debugcommands.py	Tue Mar 26 17:26:54 2019 +0100
+++ b/mercurial/debugcommands.py	Tue Mar 26 17:35:28 2019 +0100
@@ -815,7 +815,8 @@
 
     remoterevs, _checkout = hg.addbranchrevs(repo, remote, branches, revs=None)
     localrevs = opts['rev']
-    common, hds = doit(localrevs, remoterevs)
+    with util.timedcm('debug-discovery') as t:
+        common, hds = doit(localrevs, remoterevs)
 
     # compute all statistics
     common = set(common)
@@ -823,6 +824,7 @@
     lheads = set(repo.heads())
 
     data = {}
+    data['elapsed'] = t.elapsed
     data['nb-common'] = len(common)
     data['nb-common-local'] = len(common & lheads)
     data['nb-common-remote'] = len(common & rheads)
@@ -835,6 +837,7 @@
     data['nb-revs-missing'] = data['nb-revs'] - data['nb-revs-common']
 
     # display discovery summary
+    ui.write(("elapsed time:  %(elapsed)f seconds\n") % data)
     ui.write(("heads summary:\n"))
     ui.write(("  total common heads:  %(nb-common)9d\n") % data)
     ui.write(("    also local heads:  %(nb-common-local)9d\n") % data)