/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 bzrlib/__init__.py

  • Committer: Andrew Bennetts
  • Date: 2008-11-27 06:29:56 UTC
  • mfrom: (3861 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3863.
  • Revision ID: andrew.bennetts@canonical.com-20081127062956-v0a19icwk85iosx4
Merge bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
# Python version 2.0 is (2, 0, 0, 'final', 0)."  Additionally we use a
51
51
# releaselevel of 'dev' for unreleased under-development code.
52
52
 
53
 
version_info = (1, 9, 0, 'final', 0)
 
53
version_info = (1, 10, 0, 'dev', 0)
54
54
 
55
55
 
56
56
# API compatibility version: bzrlib is currently API compatible with 1.7.
64
64
    and the typical presentation used in Python output.
65
65
 
66
66
    This also checks that the version is reasonable: the sub-release must be
67
 
    zero for final releases, and non-zero for alpha, beta and preview.
 
67
    zero for final releases.
68
68
 
69
69
    >>> print _format_version_tuple((1, 0, 0, 'final', 0))
70
70
    1.0
86
86
    if len(version_info) <= 3:
87
87
        return main_version
88
88
 
89
 
    __release_type = version_info[3]
90
 
    __sub = version_info[4]
 
89
    release_type = version_info[3]
 
90
    sub = version_info[4]
91
91
 
92
92
    # check they're consistent
93
 
    if __release_type == 'final' and __sub == 0:
94
 
        __sub_string = ''
95
 
    elif __release_type == 'dev' and __sub == 0:
96
 
        __sub_string = 'dev'
97
 
    elif __release_type in ('alpha', 'beta') and __sub != 0:
98
 
        __sub_string = __release_type[0] + str(__sub)
99
 
    elif __release_type == 'candidate' and __sub != 0:
100
 
        __sub_string = 'rc' + str(__sub)
 
93
    if release_type == 'final' and sub == 0:
 
94
        sub_string = ''
 
95
    elif release_type == 'dev' and sub == 0:
 
96
        sub_string = 'dev'
 
97
    elif release_type in ('alpha', 'beta'):
 
98
        sub_string = release_type[0] + str(sub)
 
99
    elif release_type == 'candidate':
 
100
        sub_string = 'rc' + str(sub)
101
101
    else:
102
102
        raise ValueError("version_info %r not valid" % (version_info,))
103
103
 
104
104
    version_string = '%d.%d.%d.%s.%d' % version_info
105
 
    return main_version + __sub_string
 
105
    return main_version + sub_string
106
106
 
107
107
__version__ = _format_version_tuple(version_info)
108
108
version_string = __version__
109
109
 
110
110
 
111
 
# allow bzrlib plugins to be imported.
112
 
import bzrlib.plugin
113
 
bzrlib.plugin.set_plugins_path()
114
 
 
115
 
 
116
111
def test_suite():
117
112
    import tests
118
113
    return tests.test_suite()