/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 __init__.py

Add simple HACKING document.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006 Canonical Ltd
 
1
# Copyright (C) 2006-2009 Canonical Ltd
2
2
 
3
3
# Authors: Robert Collins <robert.collins@canonical.com>
4
4
#          Jelmer Vernooij <jelmer@samba.org>
21
21
 
22
22
"""A GIT branch and repository format implementation for bzr."""
23
23
 
 
24
import os
 
25
import sys
 
26
 
24
27
import bzrlib
25
28
import bzrlib.api
26
29
from bzrlib import bzrdir, errors as bzr_errors
30
33
from bzrlib.commands import plugin_cmds
31
34
from bzrlib.trace import warning
32
35
 
33
 
MINIMUM_DULWICH_VERSION = (0, 1, 0)
34
 
COMPATIBLE_BZR_VERSIONS = [(1, 11, 0), (1, 12, 0)]
 
36
# versions ending in 'exp' mean experimental mappings
 
37
# versions ending in 'dev' mean development version
 
38
# versions ending in 'final' mean release (well tested, etc)
 
39
version_info = (0, 2, 0, 'dev', 0)
 
40
 
 
41
if version_info[3] == 'final':
 
42
    version_string = '%d.%d.%d' % version_info[:3]
 
43
else:
 
44
    version_string = '%d.%d.%d%s%d' % version_info
 
45
__version__ = version_string
 
46
 
 
47
MINIMUM_DULWICH_VERSION = (0, 1, 1)
 
48
COMPATIBLE_BZR_VERSIONS = [(1, 13, 0)]
 
49
 
 
50
if getattr(sys, "frozen", None):
 
51
    # allow import additional libs from ./_lib for bzr.exe only
 
52
    sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '_lib')))
35
53
 
36
54
_versions_checked = False
37
55
def lazy_check_versions():
42
60
    try:
43
61
        from dulwich import __version__ as dulwich_version
44
62
    except ImportError:
45
 
        warning("Please install dulwich, https://launchpad.net/dulwich")
46
 
        raise
 
63
        raise ImportError("bzr-git: Please install dulwich, https://launchpad.net/dulwich")
47
64
    else:
48
65
        if dulwich_version < MINIMUM_DULWICH_VERSION:
49
 
            warning("Dulwich is too old; at least %d.%d.%d is required" % MINIMUM_DULWICH_VERSION)
50
 
            raise ImportError
 
66
            raise ImportError("bzr-git: Dulwich is too old; at least %d.%d.%d is required" % MINIMUM_DULWICH_VERSION)
51
67
 
52
68
bzrlib.api.require_any_api(bzrlib, COMPATIBLE_BZR_VERSIONS)
53
69
 
208
224
plugin_cmds.register_lazy("cmd_git_serve", [], "bzrlib.plugins.git.commands")
209
225
plugin_cmds.register_lazy("cmd_git_import", [], "bzrlib.plugins.git.commands")
210
226
 
 
227
def get_rich_root_format():
 
228
    try:
 
229
        return bzrdir.format_registry.make_bzrdir("default-rich-root")
 
230
    except KeyError:
 
231
        return bzrdir.format_registry.make_bzrdir("1.9-rich-root")
 
232
 
211
233
def test_suite():
212
234
    from bzrlib.plugins.git import tests
213
235
    return tests.test_suite()