Mercurial > hg
comparison mercurial/dispatch.py @ 30401:869d660b8669
debugcommands: introduce standalone module for debug commands
commands.py is our largest .py file by nearly 2x. Debug commands live
in a world of their own. So let's extract them to their own module.
We start with "debugancestor."
We currently reuse the commands table with commands.py and have a hack
in dispatch.py for loading debugcommands.py. In the future, we could
potentially use a separate commands table and avoid the import of
debugcommands.py.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Wed, 17 Aug 2016 21:07:38 -0700 |
parents | b19c2679289c |
children | 7f2b18c34c02 |
comparison
equal
deleted
inserted
replaced
30400:d1a0a64f6e16 | 30401:869d660b8669 |
---|---|
24 from .i18n import _ | 24 from .i18n import _ |
25 | 25 |
26 from . import ( | 26 from . import ( |
27 cmdutil, | 27 cmdutil, |
28 commands, | 28 commands, |
29 debugcommands, | |
29 demandimport, | 30 demandimport, |
30 encoding, | 31 encoding, |
31 error, | 32 error, |
32 extensions, | 33 extensions, |
33 fancyopts, | 34 fancyopts, |
766 getattr(loadermod, loadername)(ui, name, extraobj) | 767 getattr(loadermod, loadername)(ui, name, extraobj) |
767 _loaded.add(name) | 768 _loaded.add(name) |
768 | 769 |
769 # (reposetup is handled in hg.repository) | 770 # (reposetup is handled in hg.repository) |
770 | 771 |
772 # Side-effect of accessing is debugcommands module is guaranteed to be | |
773 # imported and commands.table is populated. | |
774 debugcommands.command | |
775 | |
771 addaliases(lui, commands.table) | 776 addaliases(lui, commands.table) |
772 | 777 |
773 # All aliases and commands are completely defined, now. | 778 # All aliases and commands are completely defined, now. |
774 # Check abbreviation/ambiguity of shell alias. | 779 # Check abbreviation/ambiguity of shell alias. |
775 shellaliasfn = _checkshellalias(lui, ui, args) | 780 shellaliasfn = _checkshellalias(lui, ui, args) |