Commit 1f9421df authored by Yuya Nishihara's avatar Yuya Nishihara
Browse files

debugcommands: use temporary dict for its command table

Instead, load the table by commands.py so the debug commands should always
be populated. The table in debugcommands.py is unnamed so extension authors
wouldn't be confused to wrap debugcommands.table in place of commands.table.
parent b16cb0a27377
......@@ -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
......
......@@ -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)
......
......@@ -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):
......
......@@ -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:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment