~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/builtins.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-04-01 09:03:21 UTC
  • mfrom: (5127.1.6 lazy-commands)
  • Revision ID: pqm@pqm.ubuntu.com-20100401090321-bzh43emrsqtfdne7
(mbp) lazy-load more commands

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
from bzrlib.workingtree import WorkingTree
61
61
""")
62
62
 
63
 
from bzrlib.commands import Command, display_command
 
63
from bzrlib.commands import (
 
64
    Command,
 
65
    builtin_command_registry,
 
66
    display_command,
 
67
    )
64
68
from bzrlib.option import (
65
69
    ListOption,
66
70
    Option,
4062
4066
 
4063
4067
    def run(self, file_list=None, merge_type=None, show_base=False,
4064
4068
            reprocess=False):
 
4069
        from bzrlib.conflicts import restore
4065
4070
        if merge_type is None:
4066
4071
            merge_type = _mod_merge.Merge3Merger
4067
4072
        tree, file_list = tree_files(file_list)
5975
5980
            self.outf.write('%s %s\n' % (path, location))
5976
5981
 
5977
5982
 
5978
 
from bzrlib.cmd_version_info import cmd_version_info
5979
 
from bzrlib.conflicts import cmd_resolve, cmd_conflicts, restore
5980
 
from bzrlib.foreign import cmd_dpush
5981
 
from bzrlib.sign_my_commits import cmd_sign_my_commits
 
5983
def _register_lazy_builtins():
 
5984
    # register lazy builtins from other modules; called at startup and should
 
5985
    # be only called once.
 
5986
    for (name, aliases, module_name) in [
 
5987
        ('cmd_bundle_info', [], 'bzrlib.bundle.commands'),
 
5988
        ('cmd_dpush', [], 'bzrlib.foreign'),
 
5989
        ('cmd_version_info', [], 'bzrlib.cmd_version_info'),
 
5990
        ('cmd_resolve', ['resolved'], 'bzrlib.conflicts'),
 
5991
        ('cmd_conflicts', [], 'bzrlib.conflicts'),
 
5992
        ('cmd_sign_my_commits', [], 'bzrlib.sign_my_commits'),
 
5993
        ]:
 
5994
        builtin_command_registry.register_lazy(name, aliases, module_name)