/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-05-01 07:03:04 UTC
  • mfrom: (3388.1.3 deprecated-in)
  • Revision ID: pqm@pqm.ubuntu.com-20080501070304-s4tdgkmt0ghea1i1
(mbp) Add symbol_versioning.deprecated_in

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
api_minimum_version = (0, 18, 0)
48
48
 
49
49
def _format_version_tuple(version_info):
50
 
    """Turn a version number 5-tuple into a short string.
 
50
    """Turn a version number 3-tuple or 5-tuple into a short string.
51
51
 
52
52
    This format matches <http://docs.python.org/dist/meta-data.html>
53
53
    and the typical presentation used in Python output.
61
61
    1.2dev
62
62
    >>> print _format_version_tuple((1, 1, 1, 'candidate', 2))
63
63
    1.1.1rc2
 
64
    >>> print _format_version_tuple((1, 4, 0))
 
65
    1.4
64
66
    """
65
67
    if version_info[2] == 0:
66
68
        main_version = '%d.%d' % version_info[:2]
67
69
    else:
68
70
        main_version = '%d.%d.%d' % version_info[:3]
 
71
    if len(version_info) <= 3:
 
72
        return main_version
69
73
 
70
74
    __release_type = version_info[3]
71
75
    __sub = version_info[4]