comparison mercurial/debugcommands.py @ 32377:c942c83ac2ec

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.
author Yuya Nishihara <yuya@tcha.org>
date Thu, 04 May 2017 17:13:12 +0900
parents b16cb0a27377
children 952017471f93
comparison
equal deleted inserted replaced
32376:b16cb0a27377 32377:c942c83ac2ec
30 from . import ( 30 from . import (
31 bundle2, 31 bundle2,
32 changegroup, 32 changegroup,
33 cmdutil, 33 cmdutil,
34 color, 34 color,
35 commands,
36 context, 35 context,
37 dagparser, 36 dagparser,
38 dagutil, 37 dagutil,
39 encoding, 38 encoding,
40 error, 39 error,
69 vfs as vfsmod, 68 vfs as vfsmod,
70 ) 69 )
71 70
72 release = lockmod.release 71 release = lockmod.release
73 72
74 # We reuse the command table from commands because it is easier than 73 command = registrar.command()
75 # teaching dispatch about multiple tables.
76 command = registrar.command(commands.table)
77 74
78 @command('debugancestor', [], _('[INDEX] REV1 REV2'), optionalrepo=True) 75 @command('debugancestor', [], _('[INDEX] REV1 REV2'), optionalrepo=True)
79 def debugancestor(ui, repo, *args): 76 def debugancestor(ui, repo, *args):
80 """find the ancestor revision of two revisions in a given index""" 77 """find the ancestor revision of two revisions in a given index"""
81 if len(args) == 3: 78 if len(args) == 3: