~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/__init__.py

  • Committer: Matt Nordhoff
  • Date: 2009-04-04 02:50:01 UTC
  • mfrom: (4253 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4256.
  • Revision ID: mnordhoff@mattnordhoff.com-20090404025001-z1403k0tatmc8l91
Merge bzr.dev, fixing conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
"""bzr library"""
18
18
 
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, 13, 0, 'dev', 0)
54
 
 
55
 
 
56
 
# API compatibility version: bzrlib is currently API compatible with 1.11.
57
 
api_minimum_version = (1, 11, 0)
 
53
version_info = (1, 14, 0, 'dev', 0)
 
54
 
 
55
# API compatibility version: bzrlib is currently API compatible with 1.13.
 
56
api_minimum_version = (1, 13, 0)
58
57
 
59
58
 
60
59
def _format_version_tuple(version_info):
61
 
    """Turn a version number 3-tuple or 5-tuple into a short string.
 
60
    """Turn a version number 2, 3 or 5-tuple into a short string.
62
61
 
63
62
    This format matches <http://docs.python.org/dist/meta-data.html>
64
63
    and the typical presentation used in Python output.
74
73
    1.1.1rc2
75
74
    >>> print _format_version_tuple((1, 4, 0))
76
75
    1.4
 
76
    >>> print _format_version_tuple((1, 4))
 
77
    1.4
77
78
    >>> print _format_version_tuple((1, 4, 0, 'wibble', 0))
78
79
    Traceback (most recent call last):
79
80
    ...
80
81
    ValueError: version_info (1, 4, 0, 'wibble', 0) not valid
81
82
    """
82
 
    if version_info[2] == 0:
 
83
    if len(version_info) == 2 or version_info[2] == 0:
83
84
        main_version = '%d.%d' % version_info[:2]
84
85
    else:
85
86
        main_version = '%d.%d.%d' % version_info[:3]
101
102
    else:
102
103
        raise ValueError("version_info %r not valid" % (version_info,))
103
104
 
104
 
    version_string = '%d.%d.%d.%s.%d' % version_info
 
105
    version_string = '%d.%d.%d.%s.%d' % tuple(version_info)
105
106
    return main_version + sub_string
106
107
 
 
108
 
107
109
__version__ = _format_version_tuple(version_info)
108
110
version_string = __version__
109
111