/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

Fix formatting, drop support for Bazaar < 2.0.

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
 
71
71
if getattr(sys, "frozen", None):
72
72
    # allow import additional libs from ./_lib for bzr.exe only
73
 
    sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '_lib')))
 
73
    sys.path.append(os.path.normpath(
 
74
        os.path.join(os.path.dirname(__file__), '_lib')))
74
75
 
75
76
_versions_checked = False
76
77
def lazy_check_versions():
85
86
            "bzr-git: Please install dulwich, https://launchpad.net/dulwich")
86
87
    else:
87
88
        if dulwich_version < dulwich_minimum_version:
88
 
            raise bzr_errors.DependencyNotPresent("dulwich", "bzr-git: Dulwich is too old; at least %d.%d.%d is required" % dulwich_minimum_version)
 
89
            raise bzr_errors.DependencyNotPresent("dulwich",
 
90
                "bzr-git: Dulwich is too old; at least %d.%d.%d is required" %
 
91
                    dulwich_minimum_version)
89
92
 
90
93
bzrdir.format_registry.register_lazy('git',
91
94
    "bzrlib.plugins.git.dir", "LocalGitBzrDirFormat",
134
137
        from bzrlib.transport.local import LocalTransport
135
138
        if isinstance(transport, LocalTransport):
136
139
            import dulwich
137
 
            gitrepo = dulwich.repo.Repo(transport.local_abspath(".").encode(osutils._fs_enc))
 
140
            path = transport.local_abspath(".").encode(osutils._fs_enc)
 
141
            gitrepo = dulwich.repo.Repo(path)
138
142
        else:
139
143
            from bzrlib.plugins.git.transportgit import TransportRepo
140
144
            gitrepo = TransportRepo(transport)
145
149
    @classmethod
146
150
    def probe_transport(klass, transport):
147
151
        try:
148
 
            if not transport.has_any(['info/refs', '.git/branches', 'branches']):
 
152
            if not transport.has_any(['info/refs', '.git/branches',
 
153
                                      'branches']):
149
154
                raise bzr_errors.NotBranchError(path=transport.base)
150
155
        except bzr_errors.NoSuchFile:
151
156
            raise bzr_errors.NotBranchError(path=transport.base)
273
278
    'Git Smart server protocol over TCP. (default port: 9418)')
274
279
 
275
280
 
276
 
from bzrlib.repository import network_format_registry as repository_network_format_registry
 
281
from bzrlib.repository import (
 
282
    network_format_registry as repository_network_format_registry,
 
283
    )
277
284
repository_network_format_registry.register_lazy('git',
278
285
    'bzrlib.plugins.git.repository', 'GitRepositoryFormat')
279
286
 
280
 
from bzrlib.bzrdir import network_format_registry as bzrdir_network_format_registry
 
287
from bzrlib.bzrdir import (
 
288
    network_format_registry as bzrdir_network_format_registry,
 
289
    )
281
290
bzrdir_network_format_registry.register('git', GitBzrDirFormat)
282
291
 
283
292
 
284
293
def get_rich_root_format(stacked=False):
285
 
    if stacked:
286
 
        return bzrdir.format_registry.make_bzrdir("1.9-rich-root")
287
 
    else:
288
 
        return bzrdir.format_registry.make_bzrdir("default-rich-root")
 
294
    return bzrdir.format_registry.make_bzrdir("default-rich-root")
289
295
 
290
296
send_format_registry.register_lazy('git', 'bzrlib.plugins.git.send',
291
297
                                   'send_git', 'Git am-style diff format')