23
23
lazy_import(globals(), """
24
24
from breezy import (
26
27
version_info_formats,
29
30
from breezy.i18n import gettext
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)
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(
55
53
class cmd_version_info(Command):
79
77
takes_options = [RegistryOption('format',
80
'Select the output format.',
82
lazy_registry=('breezy.version_info_formats',
78
'Select the output format.',
80
lazy_registry=('breezy.version_info_formats',
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.'),
94
91
takes_args = ['location?']
96
encoding_type = 'replace'
93
encoding_type = 'exact'
98
95
def run(self, location=None, format=None,
99
96
all=False, check_clean=False, include_history=False,
135
132
revision_id = None
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)