1
# Copyright (C) 2005 Canonical Ltd
1
# Copyright (C) 2005, 2006 Canonical Ltd
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
5
5
# the Free Software Foundation; either version 2 of the License, or
6
6
# (at your option) any later version.
8
8
# This program is distributed in the hope that it will be useful,
9
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
11
# GNU General Public License for more details.
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
Plugin for generating snapshot information about a bzr tree.
17
"""Plugin for generating snapshot information about a bzr tree."""
27
25
from bzrlib.option import Option
28
26
from bzrlib.workingtree import WorkingTree
30
from generate_version_info import version_formats
28
import version_info_formats
33
31
def _parse_version_info_format(format):
35
return version_formats[format]
33
return version_info_formats.get_builder(format)
37
formats = version_formats.keys()
35
formats = version_info_formats.get_builder_formats()
39
36
raise BzrCommandError('No known version info format %s.'
40
' Supported types are: %s'
37
' Supported types are: %s'
44
41
class cmd_version_info(Command):
45
"""Generate version information about this tree.
42
"""Generate version information about this tree."""
48
44
takes_options = [Option('format', type=_parse_version_info_format,
49
45
help='Select the output format'),
50
46
Option('all', help='include all possible information'),
51
47
Option('check-clean', help='check if tree is clean'),
52
Option('include-history',
48
Option('include-history',
53
49
help='Include the revision-history'),
54
50
Option('include-file-revisions',
55
51
help='Include the last revision for each file')