~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Vincent Ladeuil
  • Date: 2011-10-27 15:38:14 UTC
  • mfrom: (6015.44.4 2.4)
  • mto: This revision was merged to the branch mainline in revision 6236.
  • Revision ID: v.ladeuil+lp@free.fr-20111027153814-0r4nd2io1jv6t47f
Merge 2.4 into trunk including fix for bug #880701

Show diffs side-by-side

added added

removed removed

Lines of Context:
663
663
            opts['quiet'] = trace.is_quiet()
664
664
        elif opts.has_key('quiet'):
665
665
            del opts['quiet']
666
 
 
667
666
        # mix arguments and options into one dictionary
668
667
        cmdargs = _match_argform(self.name(), self.takes_args, args)
669
668
        cmdopts = {}
816
815
    try:
817
816
        options, args = parser.parse_args(args)
818
817
    except UnicodeEncodeError,e:
819
 
        raise errors.BzrCommandError(gettext('Only ASCII permitted in option names'))
 
818
        raise errors.BzrCommandError(
 
819
            gettext('Only ASCII permitted in option names'))
820
820
 
821
821
    opts = dict([(k, v) for k, v in options.__dict__.iteritems() if
822
822
                 v is not option.OptionParser.DEFAULT_VALUE])
1040
1040
 
1041
1041
    argv_copy = []
1042
1042
    i = 0
 
1043
    override_config = []
1043
1044
    while i < len(argv):
1044
1045
        a = argv[i]
1045
1046
        if a == '--profile':
1068
1069
            pass # already handled in startup script Bug #588277
1069
1070
        elif a.startswith('-D'):
1070
1071
            debug.debug_flags.add(a[2:])
 
1072
        elif a.startswith('-O'):
 
1073
            override_config.append(a[2:])
1071
1074
        else:
1072
1075
            argv_copy.append(a)
1073
1076
        i += 1
1074
1077
 
 
1078
    bzrlib.global_state.cmdline_overrides._from_cmdline(override_config)
 
1079
 
1075
1080
    debug.set_debug_flags_from_config()
1076
1081
 
1077
1082
    if not opt_no_plugins:
1129
1134
        if 'memory' in debug.debug_flags:
1130
1135
            trace.debug_memory('Process status after command:', short=False)
1131
1136
        option._verbosity_level = saved_verbosity_level
 
1137
        # Reset the overrides 
 
1138
        bzrlib.global_state.cmdline_overrides._reset()
1132
1139
 
1133
1140
 
1134
1141
def display_command(func):
1163
1170
        "bzr plugin commands")
1164
1171
    Command.hooks.install_named_hook("get_command", _get_external_command,
1165
1172
        "bzr external command lookup")
1166
 
    Command.hooks.install_named_hook("get_missing_command", _try_plugin_provider,
1167
 
        "bzr plugin-provider-db check")
 
1173
    Command.hooks.install_named_hook("get_missing_command",
 
1174
                                     _try_plugin_provider,
 
1175
                                     "bzr plugin-provider-db check")
1168
1176
 
1169
1177
 
1170
1178