/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/commands.py

  • Committer: Jelmer Vernooij
  • Date: 2020-05-24 00:39:50 UTC
  • mto: This revision was merged to the branch mainline in revision 7504.
  • Revision ID: jelmer@jelmer.uk-20200524003950-bbc545r76vc5yajg
Add github action.

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
from . import errors, registry
53
53
 
54
54
 
55
 
class BzrOptionError(errors.CommandError):
 
55
class BzrOptionError(errors.BzrCommandError):
56
56
 
57
57
    _fmt = "Error in command line options"
58
58
 
298
298
        # No command found, see if this was a typo
299
299
        candidate = guess_command(cmd_name)
300
300
        if candidate is not None:
301
 
            raise errors.CommandError(
 
301
            raise errors.BzrCommandError(
302
302
                gettext('unknown command "%s". Perhaps you meant "%s"')
303
303
                % (cmd_name, candidate))
304
 
        raise errors.CommandError(gettext('unknown command "%s"')
 
304
        raise errors.BzrCommandError(gettext('unknown command "%s"')
305
305
                                     % cmd_name)
306
306
 
307
307
 
910
910
    try:
911
911
        options, args = parser.parse_args(args)
912
912
    except UnicodeEncodeError:
913
 
        raise errors.CommandError(
 
913
        raise errors.BzrCommandError(
914
914
            gettext('Only ASCII permitted in option names'))
915
915
 
916
916
    opts = dict((k, v) for k, v in options.__dict__.items() if
935
935
                argdict[argname + '_list'] = None
936
936
        elif ap[-1] == '+':
937
937
            if not args:
938
 
                raise errors.CommandError(gettext(
 
938
                raise errors.BzrCommandError(gettext(
939
939
                    "command {0!r} needs one or more {1}").format(
940
940
                    cmd, argname.upper()))
941
941
            else:
943
943
                args = []
944
944
        elif ap[-1] == '$':  # all but one
945
945
            if len(args) < 2:
946
 
                raise errors.CommandError(
 
946
                raise errors.BzrCommandError(
947
947
                    gettext("command {0!r} needs one or more {1}").format(
948
948
                        cmd, argname.upper()))
949
949
            argdict[argname + '_list'] = args[:-1]
952
952
            # just a plain arg
953
953
            argname = ap
954
954
            if not args:
955
 
                raise errors.CommandError(
 
955
                raise errors.BzrCommandError(
956
956
                    gettext("command {0!r} requires argument {1}").format(
957
957
                        cmd, argname.upper()))
958
958
            else:
959
959
                argdict[argname] = args.pop(0)
960
960
 
961
961
    if args:
962
 
        raise errors.CommandError(gettext(
 
962
        raise errors.BzrCommandError(gettext(
963
963
            "extra argument to command {0}: {1}").format(
964
964
            cmd, args[0]))
965
965
 
1155
1155
    debug.set_debug_flags_from_config()
1156
1156
 
1157
1157
    if not opt_no_plugins:
1158
 
        from breezy import config
1159
 
        c = config.GlobalConfig()
1160
 
        warn_load_problems = not c.suppress_warning('plugin_load_failure')
1161
 
        load_plugins(warn_load_problems=warn_load_problems)
 
1158
        load_plugins()
1162
1159
    else:
1163
1160
        disable_plugins()
1164
1161
 
1255
1252
 
1256
1253
def _specified_or_unicode_argv(argv):
1257
1254
    # For internal or testing use, argv can be passed.  Otherwise, get it from
1258
 
    # the process arguments.
 
1255
    # the process arguments in a unicode-safe way.
1259
1256
    if argv is None:
1260
 
        return sys.argv[1:]
 
1257
        return osutils.get_unicode_argv()
1261
1258
    new_argv = []
1262
1259
    try:
1263
1260
        # ensure all arguments are unicode strings