diff mercurial/extensions.py @ 39509:3a86f7eb8b78

extensions: trace the total time of running all extsetup callbacks Differential Revision: https://phab.mercurial-scm.org/D4511
author Boris Feld <boris.feld@octobus.net>
date Thu, 06 Sep 2018 16:21:42 -0400
parents 1a2bfc4d756a
children 1ab185c78cc3
line wrap: on
line diff
--- a/mercurial/extensions.py	Thu Sep 06 16:20:05 2018 -0400
+++ b/mercurial/extensions.py	Thu Sep 06 16:21:42 2018 -0400
@@ -295,15 +295,17 @@
     log('> all uisetup took %s\n', alluisetupstats)
 
     log('- executing extsetup hooks\n')
-    for name in _order[newindex:]:
-        if name in broken:
-            continue
-        log('  - running extsetup for %r\n', name)
-        with util.timedcm('extsetup %r', name) as stats:
-            if not _runextsetup(name, ui):
-                log('    - the %r extension extsetup failed\n', name)
-                broken.add(name)
-        log('  > extsetup for %r took %s\n', name, stats)
+    with util.timedcm('all extsetup') as allextetupstats:
+        for name in _order[newindex:]:
+            if name in broken:
+                continue
+            log('  - running extsetup for %r\n', name)
+            with util.timedcm('extsetup %r', name) as stats:
+                if not _runextsetup(name, ui):
+                    log('    - the %r extension extsetup failed\n', name)
+                    broken.add(name)
+            log('  > extsetup for %r took %s\n', name, stats)
+    log('> all extsetup took %s\n', allextetupstats)
 
     for name in broken:
         log('    - disabling broken %r extension\n', name)