/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: Matt Nordhoff
  • Date: 2008-11-23 14:12:08 UTC
  • mto: This revision was merged to the branch mainline in revision 3849.
  • Revision ID: mnordhoff@mattnordhoff.com-20081123141208-ao19kbt7n31c13oq
Let _format_version_tuple accept alphas/betas/rcs with a subrelease of 0.

This is sometimes seen in Python's sys.version_info, presumably in svn builds or something.

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,))