26
32
user_encoding = get_user_encoding()
29
__copyright__ = "Copyright 2005, 2006, 2007 Canonical Ltd."
35
__copyright__ = "Copyright 2005, 2006, 2007, 2008 Canonical Ltd."
31
37
# same format as sys.version_info: "A tuple containing the five components of
32
38
# the version number: major, minor, micro, releaselevel, and serial. All
35
41
# Python version 2.0 is (2, 0, 0, 'final', 0)." Additionally we use a
36
42
# releaselevel of 'dev' for unreleased under-development code.
38
version_info = (0, 19, 0, 'dev', 0)
40
# API compatibility version: bzrlib is currently API compatible with 0.18.
41
api_minimum_version = (0, 18, 0)
43
if version_info[3] == 'final':
44
version_string = '%d.%d.%d' % version_info[:3]
46
version_string = '%d.%d.%d%s%d' % version_info
47
__version__ = version_string
49
from bzrlib.symbol_versioning import (deprecated_function,
55
# Kept for compatibility with 0.8, it is considered deprecated to modify it
56
DEFAULT_IGNORE = deprecated_list(zero_nine, 'DEFAULT_IGNORE', [],
57
'Consider using bzrlib.ignores.add_unique_user_ignores'
58
' or bzrlib.ignores.add_runtime_ignores')
44
version_info = (1, 8, 0, 'dev', 0)
47
# API compatibility version: bzrlib is currently API compatible with 1.7.
48
api_minimum_version = (1, 7, 0)
51
def _format_version_tuple(version_info):
52
"""Turn a version number 3-tuple or 5-tuple into a short string.
54
This format matches <http://docs.python.org/dist/meta-data.html>
55
and the typical presentation used in Python output.
57
This also checks that the version is reasonable: the sub-release must be
58
zero for final releases, and non-zero for alpha, beta and preview.
60
>>> print _format_version_tuple((1, 0, 0, 'final', 0))
62
>>> print _format_version_tuple((1, 2, 0, 'dev', 0))
64
>>> print _format_version_tuple((1, 1, 1, 'candidate', 2))
66
>>> print _format_version_tuple((1, 4, 0))
69
if version_info[2] == 0:
70
main_version = '%d.%d' % version_info[:2]
72
main_version = '%d.%d.%d' % version_info[:3]
73
if len(version_info) <= 3:
76
__release_type = version_info[3]
77
__sub = version_info[4]
79
# check they're consistent
80
if __release_type == 'final' and __sub == 0:
82
elif __release_type == 'dev' and __sub == 0:
84
elif __release_type in ('alpha', 'beta') and __sub != 0:
85
__sub_string = __release_type[0] + str(__sub)
86
elif __release_type == 'candidate' and __sub != 0:
87
__sub_string = 'rc' + str(__sub)
89
raise AssertionError("version_info %r not valid" % version_info)
91
version_string = '%d.%d.%d.%s.%d' % version_info
92
return main_version + __sub_string
94
__version__ = _format_version_tuple(version_info)
95
version_string = __version__
60
98
# allow bzrlib plugins to be imported.
61
99
import bzrlib.plugin