~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Parth Malwankar
  • Date: 2010-06-15 02:13:24 UTC
  • mto: This revision was merged to the branch mainline in revision 5303.
  • Revision ID: parth.malwankar@gmail.com-20100615021324-wegs8s7m4llufs77
updated NEWS to indicate the correct timeout for lock contention.

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)
1077
1081
    if not opt_no_aliases:
1078
1082
        alias_argv = get_alias(argv[0])
1079
1083
        if alias_argv:
1080
 
            user_encoding = osutils.get_user_encoding()
1081
 
            alias_argv = [a.decode(user_encoding) for a in alias_argv]
1082
1084
            argv[0] = alias_argv.pop(0)
1083
1085
 
1084
1086
    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
1087
    cmd_obj = get_cmd_object(cmd, plugins_override=not opt_builtin)
1090
1088
    run = cmd_obj.run_argv_aliases
1091
1089
    run_argv = [argv, alias_argv]