/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: Andrew Bennetts
  • Date: 2008-10-27 06:14:45 UTC
  • mfrom: (3793 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3795.
  • Revision ID: andrew.bennetts@canonical.com-20081027061445-eqt9lz6uw1mbvq4g
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
# timestamps relative to program start in the log file kept by bzrlib.trace.
23
23
_start_time = time.time()
24
24
 
 
25
import sys
 
26
if getattr(sys, '_bzr_lazy_regex', False):
 
27
    # The 'bzr' executable sets _bzr_lazy_regex.  We install the lazy regex
 
28
    # hack as soon as possible so that as much of the standard library can
 
29
    # benefit, including the 'string' module.
 
30
    del sys._bzr_lazy_regex
 
31
    import bzrlib.lazy_regex
 
32
    bzrlib.lazy_regex.install_lazy_compile()
 
33
 
25
34
from bzrlib.osutils import get_user_encoding
26
35
 
27
36
 
41
50
# Python version 2.0 is (2, 0, 0, 'final', 0)."  Additionally we use a
42
51
# releaselevel of 'dev' for unreleased under-development code.
43
52
 
44
 
version_info = (1, 8, 0, 'dev', 0)
 
53
version_info = (1, 9, 0, 'dev', 0)
45
54
 
46
55
 
47
56
# API compatibility version: bzrlib is currently API compatible with 1.7.
65
74
    1.1.1rc2
66
75
    >>> print _format_version_tuple((1, 4, 0))
67
76
    1.4
 
77
    >>> print _format_version_tuple((1, 4, 0, 'wibble', 0))
 
78
    Traceback (most recent call last):
 
79
    ...
 
80
    ValueError: version_info (1, 4, 0, 'wibble', 0) not valid
68
81
    """
69
82
    if version_info[2] == 0:
70
83
        main_version = '%d.%d' % version_info[:2]
86
99
    elif __release_type == 'candidate' and __sub != 0:
87
100
        __sub_string = 'rc' + str(__sub)
88
101
    else:
89
 
        raise AssertionError("version_info %r not valid" % version_info)
 
102
        raise ValueError("version_info %r not valid" % (version_info,))
90
103
 
91
104
    version_string = '%d.%d.%d.%s.%d' % version_info
92
105
    return main_version + __sub_string