/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: Canonical.com Patch Queue Manager
  • Date: 2008-11-25 15:22:32 UTC
  • mfrom: (3847.1.1 format-alpha-0)
  • Revision ID: pqm@pqm.ubuntu.com-20081125152232-c22rycit2dfzm11f
(Matt) Let _format_version_tuple accept alphas/betas/RCs with 0
        sub-releases.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
94
94
        __sub_string = ''
95
95
    elif __release_type == 'dev' and __sub == 0:
96
96
        __sub_string = 'dev'
97
 
    elif __release_type in ('alpha', 'beta') and __sub != 0:
 
97
    elif __release_type in ('alpha', 'beta'):
98
98
        __sub_string = __release_type[0] + str(__sub)
99
 
    elif __release_type == 'candidate' and __sub != 0:
 
99
    elif __release_type == 'candidate':
100
100
        __sub_string = 'rc' + str(__sub)
101
101
    else:
102
102
        raise ValueError("version_info %r not valid" % (version_info,))