~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/__init__.py

  • Committer: John Arbash Meinel
  • Date: 2008-10-30 00:55:00 UTC
  • mto: (3815.2.5 prepare-1.9)
  • mto: This revision was merged to the branch mainline in revision 3811.
  • Revision ID: john@arbash-meinel.com-20081030005500-r5cej1cxflqhs3io
Switch so that we are using a simple timestamp as the first action.

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, 6, 0, 'beta', 2)
45
 
 
46
 
 
47
 
# API compatibility version: bzrlib is currently API compatible with 0.18.
48
 
api_minimum_version = (0, 18, 0)
 
53
version_info = (1, 9, 0, 'dev', 0)
 
54
 
 
55
 
 
56
# API compatibility version: bzrlib is currently API compatible with 1.7.
 
57
api_minimum_version = (1, 7, 0)
 
58
 
49
59
 
50
60
def _format_version_tuple(version_info):
51
61
    """Turn a version number 3-tuple or 5-tuple into a short string.
64
74
    1.1.1rc2
65
75
    >>> print _format_version_tuple((1, 4, 0))
66
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
67
81
    """
68
82
    if version_info[2] == 0:
69
83
        main_version = '%d.%d' % version_info[:2]
85
99
    elif __release_type == 'candidate' and __sub != 0:
86
100
        __sub_string = 'rc' + str(__sub)
87
101
    else:
88
 
        raise AssertionError("version_info %r not valid" % version_info)
 
102
        raise ValueError("version_info %r not valid" % (version_info,))
89
103
 
90
104
    version_string = '%d.%d.%d.%s.%d' % version_info
91
105
    return main_version + __sub_string