Mercurial > public > mercurial-scm > hg-stable
diff mercurial/extensions.py @ 40505:09a37a5d8f5d
extensions: fix up many many debug logs that use %r
This gets us a bunch closer on Python 3, but I'll still have to use a
ton of sad globs. A previous version of this patch tried to preserve
the %r formatting, but upon review Yuya noted that special characters
in extension names is very unlikely, so we can just use %s and not
sweat the quoting.
Differential Revision: https://phab.mercurial-scm.org/D5002
author | Augie Fackler <augie@google.com> |
---|---|
date | Fri, 12 Oct 2018 12:30:47 -0400 |
parents | 1ab185c78cc3 |
children | cfa564037789 |
line wrap: on
line diff
--- a/mercurial/extensions.py Wed Oct 17 15:48:01 2018 -0700 +++ b/mercurial/extensions.py Fri Oct 12 12:30:47 2018 -0400 @@ -175,11 +175,11 @@ return None if shortname in _extensions: return _extensions[shortname] - log(' - loading extension: %r\n', shortname) + log(' - loading extension: %s\n', shortname) _extensions[shortname] = None - with util.timedcm('load extension %r', shortname) as stats: + with util.timedcm('load extension %s', shortname) as stats: mod = _importext(name, path, bind(_reportimporterror, ui)) - log(' > %r extension loaded in %s\n', shortname, stats) + log(' > %s extension loaded in %s\n', shortname, stats) if loadingtime is not None: loadingtime[shortname] += stats.elapsed @@ -192,13 +192,13 @@ ui.warn(_('(third party extension %s requires version %s or newer ' 'of Mercurial; disabling)\n') % (shortname, minver)) return - log(' - validating extension tables: %r\n', shortname) + log(' - validating extension tables: %s\n', shortname) _validatetables(ui, mod) _extensions[shortname] = mod _order.append(shortname) - log(' - invoking registered callbacks: %r\n', shortname) - with util.timedcm('callbacks extension %r', shortname) as stats: + log(' - invoking registered callbacks: %s\n', shortname) + with util.timedcm('callbacks extension %s', shortname) as stats: for fn in _aftercallbacks.get(shortname, []): fn(loaded=True) log(' > callbacks completed in %s\n', stats) @@ -251,7 +251,7 @@ if path: if path[0:1] == '!': if name not in _disabledextensions: - log(' - skipping disabled extension: %r\n', name) + log(' - skipping disabled extension: %s\n', name) _disabledextensions[name] = path[1:] continue try: @@ -289,12 +289,12 @@ log('- executing uisetup hooks\n') 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: + log(' - running uisetup for %s\n', name) + with util.timedcm('uisetup %s', name) as stats: if not _runuisetup(name, ui): - log(' - the %r extension uisetup failed\n', name) + log(' - the %s extension uisetup failed\n', name) broken.add(name) - log(' > uisetup for %r took %s\n', name, stats) + log(' > uisetup for %s took %s\n', name, stats) loadingtime[name] += stats.elapsed log('> all uisetup took %s\n', alluisetupstats) @@ -303,17 +303,17 @@ 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: + log(' - running extsetup for %s\n', name) + with util.timedcm('extsetup %s', name) as stats: if not _runextsetup(name, ui): - log(' - the %r extension extsetup failed\n', name) + log(' - the %s extension extsetup failed\n', name) broken.add(name) - log(' > extsetup for %r took %s\n', name, stats) + log(' > extsetup for %s took %s\n', name, stats) loadingtime[name] += stats.elapsed log('> all extsetup took %s\n', allextetupstats) for name in broken: - log(' - disabling broken %r extension\n', name) + log(' - disabling broken %s extension\n', name) _extensions[name] = None # Call aftercallbacks that were never met. @@ -324,7 +324,7 @@ continue for fn in _aftercallbacks[shortname]: - log(' - extension %r not loaded, notify callbacks\n', + log(' - extension %s not loaded, notify callbacks\n', shortname) fn(loaded=False) log('> remaining aftercallbacks completed in %s\n', stats)