/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 bzrlib/commands.py

  • Committer: Robert Collins
  • Date: 2010-07-04 06:22:11 UTC
  • mto: This revision was merged to the branch mainline in revision 5332.
  • Revision ID: robertc@robertcollins.net-20100704062211-tk9hw6bnsn5x47fm
``bzrlib.lsprof.profile`` will no longer silently generate bad threaded
profiles when concurrent profile requests are made. Instead the profile
requests will be serialised. Reentrant requests will now deadlock.
(Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
397
397
            will not mangled.
398
398
 
399
399
    :cvar hooks: An instance of CommandHooks.
 
400
    :ivar __doc__: The help shown by 'bzr help command' for this command.
 
401
        This is set by assigning explicitly to __doc__ so that -OO can
 
402
        be used::
 
403
 
 
404
        class Foo(Command):
 
405
            __doc__ = "My help goes here"
400
406
    """
401
407
    aliases = []
402
408
    takes_args = []
407
413
 
408
414
    def __init__(self):
409
415
        """Construct an instance of this command."""
410
 
        if self.__doc__ == Command.__doc__:
411
 
            warn("No help message set for %r" % self)
412
416
        # List of standard options directly supported
413
417
        self.supported_std_options = []
414
418
        self._setup_run()
482
486
            message explaining how to obtain full help.
483
487
        """
484
488
        doc = self.help()
485
 
        if doc is None:
486
 
            raise NotImplementedError("sorry, no detailed help yet for %r" % self.name())
 
489
        if not doc:
 
490
            doc = "No help for this command."
487
491
 
488
492
        # Extract the summary (purpose) and sections out from the text
489
493
        purpose,sections,order = self._get_help_parts(doc)
1050
1054
        elif a == '--coverage':
1051
1055
            opt_coverage_dir = argv[i + 1]
1052
1056
            i += 1
 
1057
        elif a == '--profile-imports':
 
1058
            pass # already handled in startup script Bug #588277
1053
1059
        elif a.startswith('-D'):
1054
1060
            debug.debug_flags.add(a[2:])
1055
1061
        else:
1077
1083
    if not opt_no_aliases:
1078
1084
        alias_argv = get_alias(argv[0])
1079
1085
        if alias_argv:
1080
 
            user_encoding = osutils.get_user_encoding()
1081
 
            alias_argv = [a.decode(user_encoding) for a in alias_argv]
1082
1086
            argv[0] = alias_argv.pop(0)
1083
1087
 
1084
1088
    cmd = argv.pop(0)
1085
 
    # We want only 'ascii' command names, but the user may have typed
1086
 
    # in a Unicode name. In that case, they should just get a
1087
 
    # 'command not found' error later.
1088
 
 
1089
1089
    cmd_obj = get_cmd_object(cmd, plugins_override=not opt_builtin)
1090
1090
    run = cmd_obj.run_argv_aliases
1091
1091
    run_argv = [argv, alias_argv]