diff --git a/hgext/largefiles/uisetup.py b/hgext/largefiles/uisetup.py --- a/hgext/largefiles/uisetup.py +++ b/hgext/largefiles/uisetup.py @@ -21,7 +21,6 @@ from mercurial import ( cmdutil, commands, copies, - debugcommands, exchange, extensions, filemerge, @@ -40,11 +39,6 @@ from . import ( ) def uisetup(ui): - # TODO: debugcommands should use a separate command table - # Side-effect of accessing is debugcommands module is guaranteed to be - # imported and commands.table is populated. - debugcommands.command - # Disable auto-status for some commands which assume that all # files in the result are under Mercurial's control diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -26,6 +26,7 @@ from . import ( changegroup, cmdutil, copies, + debugcommands as debugcommandsmod, destutil, dirstateguard, discovery, @@ -59,6 +60,7 @@ from . import ( release = lockmod.release table = {} +table.update(debugcommandsmod.command._table) command = registrar.command(table) diff --git a/mercurial/debugcommands.py b/mercurial/debugcommands.py --- a/mercurial/debugcommands.py +++ b/mercurial/debugcommands.py @@ -32,7 +32,6 @@ from . import ( changegroup, cmdutil, color, - commands, context, dagparser, dagutil, @@ -71,9 +70,7 @@ from . import ( release = lockmod.release -# We reuse the command table from commands because it is easier than -# teaching dispatch about multiple tables. -command = registrar.command(commands.table) +command = registrar.command() @command('debugancestor', [], _('[INDEX] REV1 REV2'), optionalrepo=True) def debugancestor(ui, repo, *args): diff --git a/mercurial/dispatch.py b/mercurial/dispatch.py --- a/mercurial/dispatch.py +++ b/mercurial/dispatch.py @@ -25,7 +25,6 @@ from . import ( cmdutil, color, commands, - debugcommands, demandimport, encoding, error, @@ -750,10 +749,6 @@ 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 - uis = {ui, lui} if req.repo: