/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/cmd_version_info.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
lazy_import(globals(), """
24
24
from breezy import (
25
25
    branch,
 
26
    errors,
26
27
    version_info_formats,
27
28
    workingtree,
28
29
    )
29
30
from breezy.i18n import gettext
30
31
""")
31
32
 
32
 
from . import (
33
 
    errors,
34
 
    )
35
33
from .commands import Command
36
34
from .option import Option, RegistryOption
37
35
from .sixish import text_type
47
45
        return version_info_formats.get_builder(format)
48
46
    except KeyError:
49
47
        formats = version_info_formats.get_builder_formats()
50
 
        raise errors.BzrCommandError(
51
 
            gettext('No known version info format {0}.'
52
 
                    ' Supported types are: {1}').format(format, formats))
 
48
        raise errors.BzrCommandError(gettext('No known version info format {0}.'
 
49
                                     ' Supported types are: {1}').format(
 
50
                                     format, formats))
53
51
 
54
52
 
55
53
class cmd_version_info(Command):
77
75
    """
78
76
 
79
77
    takes_options = [RegistryOption('format',
80
 
                                    'Select the output format.',
81
 
                                    value_switches=True,
82
 
                                    lazy_registry=('breezy.version_info_formats',
83
 
                                                   'format_registry')),
 
78
                            'Select the output format.',
 
79
                            value_switches=True,
 
80
                            lazy_registry=('breezy.version_info_formats',
 
81
                                           'format_registry')),
84
82
                     Option('all', help='Include all possible information.'),
85
83
                     Option('check-clean', help='Check if tree is clean.'),
86
84
                     Option('include-history',
87
85
                            help='Include the revision-history.'),
88
86
                     Option('include-file-revisions',
89
87
                            help='Include the last revision for each file.'),
90
 
                     Option('template', type=text_type,
91
 
                            help='Template for the output.'),
 
88
                     Option('template', type=text_type, help='Template for the output.'),
92
89
                     'revision',
93
90
                     ]
94
91
    takes_args = ['location?']
95
92
 
96
 
    encoding_type = 'replace'
 
93
    encoding_type = 'exact'
97
94
 
98
95
    def run(self, location=None, format=None,
99
96
            all=False, check_clean=False, include_history=False,
135
132
            revision_id = None
136
133
 
137
134
        builder = format(b, working_tree=wt,
138
 
                         check_for_clean=check_clean,
139
 
                         include_revision_history=include_history,
140
 
                         include_file_revisions=include_file_revisions,
141
 
                         template=template, revision_id=revision_id)
 
135
                check_for_clean=check_clean,
 
136
                include_revision_history=include_history,
 
137
                include_file_revisions=include_file_revisions,
 
138
                template=template, revision_id=revision_id)
142
139
        builder.generate(self.outf)