40
40
# Python version 2.0 is (2, 0, 0, 'final', 0)." Additionally we use a
41
41
# releaselevel of 'dev' for unreleased under-development code.
43
version_info = (1, 3, 0, 'dev', 0)
43
version_info = (1, 4, 0, 'dev', 0)
45
45
# API compatibility version: bzrlib is currently API compatible with 0.18.
46
46
api_minimum_version = (0, 18, 0)
48
if version_info[3] == 'final':
49
version_string = '%d.%d.%d' % version_info[:3]
48
def _format_version_tuple(version_info):
49
"""Turn a version number 5-tuple into a short string.
51
This format matches <http://docs.python.org/dist/meta-data.html>
52
and the typical presentation used in Python output.
54
This also checks that the version is reasonable: the sub-release must be
55
zero for final releases, and non-zero for alpha, beta and preview.
57
>>> print _format_version_tuple((1, 0, 0, 'final', 0))
59
>>> print _format_version_tuple((1, 2, 0, 'dev', 0))
61
>>> print _format_version_tuple((1, 1, 1, 'candidate', 2))
64
if version_info[2] == 0:
65
main_version = '%d.%d' % version_info[:2]
67
main_version = '%d.%d.%d' % version_info[:3]
69
__release_type = version_info[3]
70
__sub = version_info[4]
72
# check they're consistent
73
if __release_type == 'final' and __sub == 0:
75
elif __release_type == 'dev' and __sub == 0:
77
elif __release_type in ('alpha', 'beta') and __sub != 0:
78
__sub_string = __release_type[0] + str(__sub)
79
elif __release_type == 'candidate' and __sub != 0:
80
__sub_string = 'rc' + str(__sub)
82
raise AssertionError("version_info %r not valid" % version_info)
51
84
version_string = '%d.%d.%d.%s.%d' % version_info
52
__version__ = version_string
85
return main_version + __sub_string
87
__version__ = _format_version_tuple(version_info)
88
version_string = __version__
54
91
# allow bzrlib plugins to be imported.
55
92
import bzrlib.plugin