~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/commands.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-04-19 04:37:48 UTC
  • mfrom: (5741.3.8 506265-command-deprecation)
  • Revision ID: pqm@pqm.ubuntu.com-20110419043748-qq4lsmc50cckqzp7
(mbp) Deprecate 'bzr clone' and 'bzr get' (bug 506265) (Martin Pool)

Show diffs side-by-side

added added

removed removed

Lines of Context:
273
273
    # Allow plugins to extend commands
274
274
    for hook in Command.hooks['extend_command']:
275
275
        hook(cmd)
 
276
    if getattr(cmd, 'invoked_as', None) is None:
 
277
        cmd.invoked_as = cmd_name
276
278
    return cmd
277
279
 
278
280
 
394
396
            sys.stdout is forced to be a binary stream, and line-endings
395
397
            will not mangled.
396
398
 
 
399
    :ivar invoked_as:
 
400
        A string indicating the real name under which this command was
 
401
        invoked, before expansion of aliases. 
 
402
        (This may be None if the command was constructed and run in-process.)
 
403
 
397
404
    :cvar hooks: An instance of CommandHooks.
 
405
 
398
406
    :ivar __doc__: The help shown by 'bzr help command' for this command.
399
407
        This is set by assigning explicitly to __doc__ so that -OO can
400
408
        be used::
406
414
    takes_args = []
407
415
    takes_options = []
408
416
    encoding_type = 'strict'
 
417
    invoked_as = None
409
418
 
410
419
    hidden = False
411
420
 
749
758
        return getdoc(self)
750
759
 
751
760
    def name(self):
 
761
        """Return the canonical name for this command.
 
762
 
 
763
        The name under which it was actually invoked is available in invoked_as.
 
764
        """
752
765
        return _unsquish_command_name(self.__class__.__name__)
753
766
 
754
767
    def plugin_name(self):