comparison mercurial/dispatch.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 9c023179e8d0
children 71e735bd8170
comparison
equal deleted inserted replaced
32376:b16cb0a27377 32377:c942c83ac2ec
23 23
24 from . import ( 24 from . import (
25 cmdutil, 25 cmdutil,
26 color, 26 color,
27 commands, 27 commands,
28 debugcommands,
29 demandimport, 28 demandimport,
30 encoding, 29 encoding,
31 error, 30 error,
32 extensions, 31 extensions,
33 fancyopts, 32 fancyopts,
747 if cwd: 746 if cwd:
748 os.chdir(cwd[-1]) 747 os.chdir(cwd[-1])
749 748
750 rpath = _earlygetopt(["-R", "--repository", "--repo"], args) 749 rpath = _earlygetopt(["-R", "--repository", "--repo"], args)
751 path, lui = _getlocal(ui, rpath) 750 path, lui = _getlocal(ui, rpath)
752
753 # Side-effect of accessing is debugcommands module is guaranteed to be
754 # imported and commands.table is populated.
755 debugcommands.command
756 751
757 uis = {ui, lui} 752 uis = {ui, lui}
758 753
759 if req.repo: 754 if req.repo:
760 uis.add(req.repo.ui) 755 uis.add(req.repo.ui)