D4510: extensions: trace the total time of running all uisetup callbacks

lothiraldan (Boris Feld) phabricator at mercurial-scm.org
Mon Sep 10 14:38:48 EDT 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG4fdd11520d80: extensions: trace the total time of running all uisetup callbacks (authored by lothiraldan, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D4510?vs=10844&id=10863

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

AFFECTED FILES
  mercurial/extensions.py
  tests/test-bad-extension.t
  tests/test-extension-timing.t

CHANGE DETAILS

diff --git a/tests/test-extension-timing.t b/tests/test-extension-timing.t
--- a/tests/test-extension-timing.t
+++ b/tests/test-extension-timing.t
@@ -59,6 +59,7 @@
   uisetup called
   uisetup called [status]
   debug.extensions:   > uisetup for 'foobar' took * (glob)
+  debug.extensions: > all uisetup took * (glob)
   debug.extensions: - executing extsetup hooks
   debug.extensions:   - running extsetup for 'foobar'
   debug.extensions:   > extsetup for 'foobar' took * (glob)
@@ -72,6 +73,7 @@
   debug.extensions: > loaded 0 extensions, total time * (glob)
   debug.extensions: - loading configtable attributes
   debug.extensions: - executing uisetup hooks
+  debug.extensions: > all uisetup took * (glob)
   debug.extensions: - executing extsetup hooks
   debug.extensions: - executing remaining aftercallbacks
   debug.extensions: > remaining aftercallbacks completed in * (glob)
diff --git a/tests/test-bad-extension.t b/tests/test-bad-extension.t
--- a/tests/test-bad-extension.t
+++ b/tests/test-bad-extension.t
@@ -111,6 +111,7 @@
   debug.extensions:   > uisetup for 'gpg' took * (glob)
   debug.extensions:   - running uisetup for 'baddocext'
   debug.extensions:   > uisetup for 'baddocext' took * (glob)
+  debug.extensions: > all uisetup took * (glob)
   debug.extensions: - executing extsetup hooks
   debug.extensions:   - running extsetup for 'gpg'
   debug.extensions:   > extsetup for 'gpg' took * (glob)
diff --git a/mercurial/extensions.py b/mercurial/extensions.py
--- a/mercurial/extensions.py
+++ b/mercurial/extensions.py
@@ -284,13 +284,15 @@
 
     broken = set()
     log('- executing uisetup hooks\n')
-    for name in _order[newindex:]:
-        log('  - running uisetup for %r\n', name)
-        with util.timedcm('uisetup %r', name) as stats:
-            if not _runuisetup(name, ui):
-                log('    - the %r extension uisetup failed\n', name)
-                broken.add(name)
-        log('  > uisetup for %r took %s\n', name, stats)
+    with util.timedcm('all uisetup') as alluisetupstats:
+        for name in _order[newindex:]:
+            log('  - running uisetup for %r\n', name)
+            with util.timedcm('uisetup %r', name) as stats:
+                if not _runuisetup(name, ui):
+                    log('    - the %r extension uisetup failed\n', name)
+                    broken.add(name)
+            log('  > uisetup for %r took %s\n', name, stats)
+    log('> all uisetup took %s\n', alluisetupstats)
 
     log('- executing extsetup hooks\n')
     for name in _order[newindex:]:



To: lothiraldan, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list