/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/help.py

  • Committer: Jelmer Vernooij
  • Date: 2018-05-06 11:48:54 UTC
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@jelmer.uk-20180506114854-h4qd9ojaqy8wxjsd
Move .mailmap to root.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 
24
24
# TODO: `help commands --all` should show hidden commands
25
25
 
 
26
import sys
 
27
 
26
28
from . import (
27
29
    commands as _mod_commands,
28
30
    errors,
37
39
class NoHelpTopic(errors.BzrError):
38
40
 
39
41
    _fmt = ("No help could be found for '%(topic)s'. "
40
 
            "Please use 'brz help topics' to obtain a list of topics.")
 
42
        "Please use 'brz help topics' to obtain a list of topics.")
41
43
 
42
44
    def __init__(self, topic):
43
45
        self.topic = topic
56
58
        shadowed_terms = []
57
59
        for index, topic_obj in topics[1:]:
58
60
            shadowed_terms.append('%s%s' % (index.prefix,
59
 
                                            topic_obj.get_help_topic()))
 
61
                topic_obj.get_help_topic()))
60
62
        source = topics[0][1]
61
63
        outfile.write(source.get_help_text(shadowed_terms))
62
64
    except NoHelpTopic:
65
67
 
66
68
    if alias is not None:
67
69
        outfile.write("'brz %s' is an alias for 'brz %s'.\n" % (topic,
68
 
                                                                " ".join(alias)))
 
70
            " ".join(alias)))
69
71
 
70
72
 
71
73
def help_commands(outfile=None):
167
169
        self._check_prefix_uniqueness()
168
170
        result = []
169
171
        for index in self.search_path:
170
 
            result.extend([(index, _topic)
171
 
                           for _topic in index.get_topics(topic)])
 
172
            result.extend([(index, _topic) for _topic in index.get_topics(topic)])
172
173
        if not result:
173
174
            raise NoHelpTopic(topic)
174
175
        else: