diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py --- a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -655,6 +655,10 @@ def _dispatch(req): rpath = _earlygetopt(["-R", "--repository", "--repo"], args) path, lui = _getlocal(ui, rpath) + # Side-effect of accessing is debugcommands module is guaranteed to be + # imported and commands.table is populated. + debugcommands.command + # Configure extensions in phases: uisetup, extsetup, cmdtable, and # reposetup. Programs like TortoiseHg will call _dispatch several # times so we keep track of configured extensions in _loaded. @@ -674,10 +678,6 @@ def _dispatch(req): # (reposetup is handled in hg.repository) - # Side-effect of accessing is debugcommands module is guaranteed to be - # imported and commands.table is populated. - debugcommands.command - addaliases(lui, commands.table) # All aliases and commands are completely defined, now.