~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/__init__.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-11-27 05:24:15 UTC
  • mfrom: (3849.2.1 jam-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20081127052415-9hb2n5pppt7imsb3
(mbp, for jam) version_info code cleanup

Show diffs side-by-side

added added

removed removed

Lines of Context:
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'):
98
 
        __sub_string = __release_type[0] + str(__sub)
99
 
    elif __release_type == 'candidate':
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__