/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to __init__.py

Allow bzr-gtk and Bazaar versions to be out of sync. No longer warn about 
newer versions of Bazaar, on the assumption the API is sufficiently stable now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
    version_string = '%d.%d.%d%s%d' % version_info
45
45
__version__ = version_string
46
46
 
 
47
required_bzrlib = (1, 0)
 
48
 
47
49
def check_bzrlib_version(desired):
48
50
    """Check that bzrlib is compatible.
49
51
 
50
52
    If version is < bzr-gtk version, assume incompatible.
51
 
    If version == bzr-gtk version, assume completely compatible
52
 
    If version == bzr-gtk version + 1, assume compatible, with deprecations
53
 
    Otherwise, assume incompatible.
54
53
    """
55
 
    desired_plus = (desired[0], desired[1]+1)
56
54
    bzrlib_version = bzrlib.version_info[:2]
57
 
    if bzrlib_version == desired or (bzrlib_version == desired_plus and
58
 
                                     bzrlib.version_info[3] == 'dev'):
59
 
        return
60
55
    try:
61
56
        from bzrlib.trace import warning
62
57
    except ImportError:
67
62
        warning('Installed Bazaar version %s is too old to be used with bzr-gtk'
68
63
                ' %s.' % (bzrlib.__version__, __version__))
69
64
        raise BzrError('Version mismatch: %r, %r' % (version_info, bzrlib.version_info) )
70
 
    else:
71
 
        warning('bzr-gtk is not up to date with installed bzr version %s.'
72
 
                ' \nThere should be a newer version available, e.g. %i.%i.' 
73
 
                % (bzrlib.__version__, bzrlib_version[0], bzrlib_version[1]))
74
65
 
75
66
 
76
67
if version_info[2] == "final":
77
 
    check_bzrlib_version(version_info[:2])
 
68
    check_bzrlib_version(required_bzrlib)
78
69
 
79
70
from bzrlib.trace import warning
80
71
if __name__ != 'bzrlib.plugins.gtk':