/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

Avoid revision_history if it's not necessary.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
 
42
42
bzrlib.api.require_any_api(bzrlib, bzr_compatible_versions)
43
43
 
 
44
try:
 
45
    from bzrlib.i18n import load_plugin_translations
 
46
except ImportError: # No translations for bzr < 2.5
 
47
    gettext = lambda x: x
 
48
else:
 
49
    translation = load_plugin_translations("bzr-git")
 
50
    gettext = translation.gettext
44
51
 
45
52
from bzrlib import (
46
53
    errors as bzr_errors,
47
 
    osutils,
48
 
    )
49
 
try:
50
 
    from bzrlib.controldir import (
51
 
        ControlDirFormat,
52
 
        ControlDir,
53
 
        Prober,
54
 
        format_registry,
55
 
        )
56
 
except ImportError:
57
 
    # bzr < 2.3
58
 
    from bzrlib.bzrdir import (
59
 
        BzrDirFormat,
60
 
        BzrDir,
61
 
        format_registry,
62
 
        )
63
 
    ControlDir = BzrDir
64
 
    ControlDirFormat = BzrDirFormat
65
 
    Prober = object
66
 
    has_controldir = False
67
 
else:
68
 
    has_controldir = True
 
54
    trace,
 
55
    )
 
56
 
 
57
from bzrlib.controldir import (
 
58
    ControlDirFormat,
 
59
    Prober,
 
60
    format_registry,
 
61
    network_format_registry as controldir_network_format_registry,
 
62
    )
69
63
 
70
64
from bzrlib.foreign import (
71
65
    foreign_vcs_registry,
73
67
from bzrlib.help_topics import (
74
68
    topic_registry,
75
69
    )
76
 
from bzrlib.lockable_files import (
77
 
    TransportLock,
78
 
    )
79
70
from bzrlib.transport import (
80
71
    register_lazy_transport,
81
72
    register_transport_proto,
83
74
from bzrlib.commands import (
84
75
    plugin_cmds,
85
76
    )
86
 
from bzrlib.version_info_formats.format_rio import (
87
 
    RioVersionInfoBuilder,
88
 
    )
89
77
from bzrlib.send import (
90
78
    format_registry as send_format_registry,
91
79
    )
133
121
revspec_registry.register_lazy("git:", "bzrlib.plugins.git.revspec",
134
122
    "RevisionSpec_git")
135
123
 
136
 
try:
137
 
    from bzrlib.revisionspec import dwim_revspecs
138
 
except ImportError:
139
 
    pass
140
 
else:
 
124
from bzrlib.revisionspec import dwim_revspecs, RevisionSpec_dwim
 
125
if getattr(RevisionSpec_dwim, "append_possible_lazy_revspec", None):
 
126
    RevisionSpec_dwim.append_possible_lazy_revspec(
 
127
        "bzrlib.plugins.git.revspec", "RevisionSpec_git")
 
128
else: # bzr < 2.4
141
129
    from bzrlib.plugins.git.revspec import RevisionSpec_git
142
130
    dwim_revspecs.append(RevisionSpec_git)
143
131
 
144
132
 
145
 
class GitControlDirFormat(ControlDirFormat):
146
 
 
147
 
    _lock_class = TransportLock
148
 
 
149
 
    colocated_branches = True
150
 
 
151
 
    def __eq__(self, other):
152
 
        return type(self) == type(other)
153
 
 
154
 
    def is_supported(self):
155
 
        return True
156
 
 
157
 
    def network_name(self):
158
 
        return "git"
159
 
 
160
 
 
161
133
class LocalGitProber(Prober):
162
134
 
163
135
    def probe_transport(self, transport):
164
136
        try:
165
 
            if not transport.has_any(['info/refs', '.git/branches',
166
 
                                      'branches']):
167
 
                raise bzr_errors.NotBranchError(path=transport.base)
168
 
        except bzr_errors.NoSuchFile:
 
137
            external_url = transport.external_url()
 
138
        except bzr_errors.InProcessTransport:
 
139
            raise bzr_errors.NotBranchError(path=transport.base)
 
140
        if (external_url.startswith("http:") or
 
141
            external_url.startswith("https:")):
 
142
            # Already handled by RemoteGitProber
169
143
            raise bzr_errors.NotBranchError(path=transport.base)
170
144
        from bzrlib import urlutils
171
145
        if urlutils.split(transport.base)[1] == ".git":
172
146
            raise bzr_errors.NotBranchError(path=transport.base)
 
147
        if not transport.has_any(['objects', '.git/objects']):
 
148
            raise bzr_errors.NotBranchError(path=transport.base)
173
149
        lazy_check_versions()
174
 
        import dulwich
175
 
        from bzrlib.plugins.git.transportgit import TransportRepo
176
 
        try:
177
 
            gitrepo = TransportRepo(transport)
178
 
        except dulwich.errors.NotGitRepository, e:
179
 
            raise bzr_errors.NotBranchError(path=transport.base)
 
150
        from bzrlib.plugins.git.dir import (
 
151
            BareLocalGitControlDirFormat,
 
152
            LocalGitControlDirFormat,
 
153
            )
 
154
        if transport.has_any(['.git/objects']):
 
155
            return LocalGitControlDirFormat()
 
156
        if transport.has('info') and transport.has('objects'):
 
157
            return BareLocalGitControlDirFormat()
 
158
        raise bzr_errors.NotBranchError(path=transport.base)
 
159
 
 
160
    @classmethod
 
161
    def known_formats(cls):
 
162
        from bzrlib.plugins.git.dir import (
 
163
            BareLocalGitControlDirFormat,
 
164
            LocalGitControlDirFormat,
 
165
            )
 
166
        return set([BareLocalGitControlDirFormat(), LocalGitControlDirFormat()])
 
167
 
 
168
 
 
169
class RemoteGitProber(Prober):
 
170
 
 
171
    def probe_http_transport(self, transport):
 
172
        from bzrlib import urlutils
 
173
        url = urlutils.join(transport.external_url(), "info/refs") + "?service=git-upload-pack"
 
174
        from bzrlib.transport.http._urllib import HttpTransport_urllib, Request
 
175
        if isinstance(transport, HttpTransport_urllib):
 
176
            req = Request('GET', url, accepted_errors=[200, 403, 404, 405],
 
177
                          headers={"Content-Type": "application/x-git-upload-pack-request"})
 
178
            req.follow_redirections = True
 
179
            resp = transport._perform(req)
 
180
            if resp.code in (404, 405):
 
181
                raise bzr_errors.NotBranchError(transport.base)
 
182
            headers = resp.headers
 
183
            refs_text = resp.read()
180
184
        else:
181
 
            if gitrepo.bare:
182
 
                return BareLocalGitControlDirFormat()
 
185
            try:
 
186
                from bzrlib.transport.http._pycurl import PyCurlTransport
 
187
            except bzr_errors.DependencyNotPresent:
 
188
                raise bzr_errors.NotBranchError(transport.base)
183
189
            else:
184
 
                return LocalGitControlDirFormat()
185
 
 
186
 
 
187
 
class LocalGitControlDirFormat(GitControlDirFormat):
188
 
    """The .git directory control format."""
189
 
 
190
 
    bare = False
191
 
 
192
 
    @classmethod
193
 
    def _known_formats(self):
194
 
        return set([LocalGitControlDirFormat()])
195
 
 
196
 
    def open(self, transport, _found=None):
197
 
        """Open this directory.
198
 
 
199
 
        """
200
 
        lazy_check_versions()
201
 
        from bzrlib.plugins.git.transportgit import TransportRepo
202
 
        gitrepo = TransportRepo(transport)
203
 
        from bzrlib.plugins.git.dir import LocalGitDir, GitLockableFiles, GitLock
204
 
        lockfiles = GitLockableFiles(transport, GitLock())
205
 
        return LocalGitDir(transport, lockfiles, gitrepo, self)
206
 
 
207
 
    @classmethod
208
 
    def probe_transport(klass, transport):
209
 
        prober = LocalGitProber()
210
 
        return prober.probe_transport(transport)
211
 
 
212
 
    def get_format_description(self):
213
 
        return "Local Git Repository"
214
 
 
215
 
    def initialize_on_transport(self, transport):
216
 
        from bzrlib.transport.local import LocalTransport
217
 
 
218
 
        if not isinstance(transport, LocalTransport):
219
 
            raise NotImplementedError(self.initialize,
220
 
                "Can't create Git Repositories/branches on "
221
 
                "non-local transports")
222
 
        lazy_check_versions()
223
 
        from dulwich.repo import Repo
224
 
        Repo.init(transport.local_abspath(".").encode(osutils._fs_enc),
225
 
            bare=self.bare)
226
 
        return self.open(transport)
227
 
 
228
 
    def is_supported(self):
229
 
        return True
230
 
 
231
 
 
232
 
class BareLocalGitControlDirFormat(LocalGitControlDirFormat):
233
 
 
234
 
    bare = True
235
 
    supports_workingtrees = False
236
 
 
237
 
    @classmethod
238
 
    def _known_formats(self):
239
 
        return set([RemoteGitControlDirFormat()])
240
 
 
241
 
    def get_format_description(self):
242
 
        return "Local Git Repository (bare)"
243
 
 
244
 
 
245
 
class RemoteGitProber(Prober):
 
190
                import pycurl
 
191
                from cStringIO import StringIO
 
192
                if isinstance(transport, PyCurlTransport):
 
193
                    conn = transport._get_curl()
 
194
                    conn.setopt(pycurl.URL, url)
 
195
                    conn.setopt(pycurl.FOLLOWLOCATION, 1)
 
196
                    transport._set_curl_options(conn)
 
197
                    conn.setopt(pycurl.HTTPGET, 1)
 
198
                    header = StringIO()
 
199
                    data = StringIO()
 
200
                    conn.setopt(pycurl.HEADERFUNCTION, header.write)
 
201
                    conn.setopt(pycurl.WRITEFUNCTION, data.write)
 
202
                    transport._curl_perform(conn, header,
 
203
                        ["Content-Type: application/x-git-upload-pack-request"])
 
204
                    code = conn.getinfo(pycurl.HTTP_CODE)
 
205
                    if code in (404, 405):
 
206
                        raise bzr_errors.NotBranchError(transport.base)
 
207
                    if code != 200:
 
208
                        raise bzr_errors.InvalidHttpResponse(transport._path,
 
209
                            str(code))
 
210
                    headers = transport._parse_headers(header)
 
211
                else:
 
212
                    raise bzr_errors.NotBranchError(transport.base)
 
213
                refs_text = data.getvalue()
 
214
        ct = headers.getheader("Content-Type")
 
215
        if ct is None:
 
216
            raise bzr_errors.NotBranchError(transport.base)
 
217
        if ct.startswith("application/x-git"):
 
218
            from bzrlib.plugins.git.remote import RemoteGitControlDirFormat
 
219
            return RemoteGitControlDirFormat()
 
220
        else:
 
221
            from bzrlib.plugins.git.dir import (
 
222
                BareLocalGitControlDirFormat,
 
223
                )
 
224
            ret = BareLocalGitControlDirFormat()
 
225
            ret._refs_text = refs_text
 
226
            return ret
246
227
 
247
228
    def probe_transport(self, transport):
248
 
        url = transport.base
249
 
        if url.startswith('readonly+'):
250
 
            url = url[len('readonly+'):]
251
 
        if (not url.startswith("git://") and not url.startswith("git+")):
 
229
        try:
 
230
            external_url = transport.external_url()
 
231
        except bzr_errors.InProcessTransport:
 
232
            raise bzr_errors.NotBranchError(path=transport.base)
 
233
 
 
234
        if (external_url.startswith("http:") or
 
235
            external_url.startswith("https:")):
 
236
            return self.probe_http_transport(transport)
 
237
 
 
238
        if (not external_url.startswith("git://") and
 
239
            not external_url.startswith("git+")):
252
240
            raise bzr_errors.NotBranchError(transport.base)
 
241
 
253
242
        # little ugly, but works
254
 
        from bzrlib.plugins.git.remote import GitSmartTransport
255
 
        if not isinstance(transport, GitSmartTransport):
256
 
            raise bzr_errors.NotBranchError(transport.base)
257
 
        return RemoteGitControlDirFormat()
258
 
 
259
 
 
260
 
 
261
 
class RemoteGitControlDirFormat(GitControlDirFormat):
262
 
    """The .git directory control format."""
263
 
 
264
 
    supports_workingtrees = False
 
243
        from bzrlib.plugins.git.remote import (
 
244
            GitSmartTransport,
 
245
            RemoteGitControlDirFormat,
 
246
            )
 
247
        if isinstance(transport, GitSmartTransport):
 
248
            return RemoteGitControlDirFormat()
 
249
        raise bzr_errors.NotBranchError(path=transport.base)
265
250
 
266
251
    @classmethod
267
 
    def _known_formats(self):
 
252
    def known_formats(cls):
 
253
        from bzrlib.plugins.git.remote import RemoteGitControlDirFormat
268
254
        return set([RemoteGitControlDirFormat()])
269
255
 
270
 
    def open(self, transport, _found=None):
271
 
        """Open this directory.
272
 
 
273
 
        """
274
 
        # we dont grok readonly - git isn't integrated with transport.
275
 
        url = transport.base
276
 
        if url.startswith('readonly+'):
277
 
            url = url[len('readonly+'):]
278
 
        if (not url.startswith("git://") and not url.startswith("git+")):
279
 
            raise bzr_errors.NotBranchError(transport.base)
280
 
        from bzrlib.plugins.git.remote import RemoteGitDir, GitSmartTransport
281
 
        if not isinstance(transport, GitSmartTransport):
282
 
            raise bzr_errors.NotBranchError(transport.base)
283
 
        from bzrlib.plugins.git.dir import GitLockableFiles, GitLock
284
 
        lockfiles = GitLockableFiles(transport, GitLock())
285
 
        return RemoteGitDir(transport, lockfiles, self)
286
 
 
287
 
    @classmethod
288
 
    def probe_transport(klass, transport):
289
 
        """Our format is present if the transport ends in '.not/'."""
290
 
        prober = RemoteGitProber()
291
 
        return prober.probe_transport(transport)
292
 
 
293
 
    def get_format_description(self):
294
 
        return "Remote Git Repository"
295
 
 
296
 
    def initialize_on_transport(self, transport):
297
 
        raise bzr_errors.UninitializableFormat(self)
298
 
 
299
 
 
300
 
if has_controldir:
 
256
 
 
257
if not getattr(Prober, "known_formats", None): # bzr < 2.4
 
258
    from bzrlib.plugins.git.dir import (
 
259
        LocalGitControlDirFormat, BareLocalGitControlDirFormat,
 
260
        )
 
261
    from bzrlib.plugins.git.remote import RemoteGitControlDirFormat
301
262
    ControlDirFormat.register_format(LocalGitControlDirFormat())
302
263
    ControlDirFormat.register_format(BareLocalGitControlDirFormat())
303
264
    ControlDirFormat.register_format(RemoteGitControlDirFormat())
304
 
    ControlDirFormat.register_prober(LocalGitProber)
305
 
    ControlDirFormat.register_prober(RemoteGitProber)
306
 
else:
307
 
    ControlDirFormat.register_control_format(LocalGitControlDirFormat)
308
 
    ControlDirFormat.register_control_format(BareLocalGitControlDirFormat)
309
 
    ControlDirFormat.register_control_format(RemoteGitControlDirFormat)
 
265
    # Provide RevisionTree.get_file_revision, so various parts of bzr-svn
 
266
    # can avoid inventories.
 
267
    from bzrlib.revisiontree import RevisionTree
 
268
    def get_file_revision(tree, file_id, path=None):
 
269
        return tree.inventory[file_id].revision
 
270
    RevisionTree.get_file_revision = get_file_revision
 
271
 
 
272
ControlDirFormat.register_prober(LocalGitProber)
 
273
ControlDirFormat._server_probers.insert(0, RemoteGitProber)
310
274
 
311
275
register_transport_proto('git://',
312
276
        help="Access using the Git smart server protocol.")
319
283
                        'SSHGitSmartTransport')
320
284
 
321
285
foreign_vcs_registry.register_lazy("git",
322
 
    "bzrlib.plugins.git.mapping", "foreign_git", "Stupid content tracker")
 
286
    "bzrlib.plugins.git.mapping", "foreign_vcs_git", "Stupid content tracker")
323
287
 
324
288
plugin_cmds.register_lazy("cmd_git_import", [], "bzrlib.plugins.git.commands")
325
289
plugin_cmds.register_lazy("cmd_git_object", ["git-objects", "git-cat"],
327
291
plugin_cmds.register_lazy("cmd_git_refs", [], "bzrlib.plugins.git.commands")
328
292
plugin_cmds.register_lazy("cmd_git_apply", [], "bzrlib.plugins.git.commands")
329
293
 
 
294
def extract_git_foreign_revid(rev):
 
295
    try:
 
296
        foreign_revid = rev.foreign_revid
 
297
    except AttributeError:
 
298
        from bzrlib.plugins.git.mapping import mapping_registry
 
299
        foreign_revid, mapping = \
 
300
            mapping_registry.parse_revision_id(rev.revision_id)
 
301
        return foreign_revid
 
302
    else:
 
303
        from bzrlib.plugins.git.mapping import foreign_vcs_git
 
304
        if rev.mapping.vcs == foreign_vcs_git:
 
305
            return foreign_revid
 
306
        else:
 
307
            raise bzr_errors.InvalidRevisionId(rev.revision_id, None)
 
308
 
 
309
 
330
310
def update_stanza(rev, stanza):
331
311
    mapping = getattr(rev, "mapping", None)
332
 
    if mapping is not None and mapping.revid_prefix.startswith("git-"):
333
 
        stanza.add("git-commit", rev.foreign_revid)
334
 
 
335
 
 
336
 
rio_hooks = getattr(RioVersionInfoBuilder, "hooks", None)
337
 
if rio_hooks is not None:
338
 
    rio_hooks.install_named_hook('revision', update_stanza, None)
 
312
    try:
 
313
        git_commit = extract_git_foreign_revid(rev)
 
314
    except bzr_errors.InvalidRevisionId:
 
315
        pass
 
316
    else:
 
317
        stanza.add("git-commit", git_commit)
 
318
 
 
319
try:
 
320
    from bzrlib.hooks import install_lazy_named_hook
 
321
except ImportError: # Compatibility with bzr < 2.4
 
322
    from bzrlib.version_info_formats.format_rio import (
 
323
        RioVersionInfoBuilder,
 
324
        )
 
325
    RioVersionInfoBuilder.hooks.install_named_hook('revision', update_stanza,
 
326
        "git commits")
 
327
else:
 
328
    install_lazy_named_hook("bzrlib.version_info_formats.format_rio",
 
329
        "RioVersionInfoBuilder.hooks", "revision", update_stanza,
 
330
        "git commits")
339
331
 
340
332
 
341
333
from bzrlib.transport import transport_server_registry
344
336
    'serve_git',
345
337
    'Git Smart server protocol over TCP. (default port: 9418)')
346
338
 
 
339
transport_server_registry.register_lazy('git-receive-pack',
 
340
    'bzrlib.plugins.git.server',
 
341
    'serve_git_receive_pack',
 
342
    help='Git Smart server receive pack command (inetd mode only)')
 
343
transport_server_registry.register_lazy('git-upload-pack',
 
344
    'bzrlib.plugins.git.server',
 
345
    'serve_git_upload_pack',
 
346
    help='Git Smart server upload pack command (inetd mode only)')
347
347
 
348
348
from bzrlib.repository import (
 
349
    format_registry as repository_format_registry,
349
350
    network_format_registry as repository_network_format_registry,
350
351
    )
351
352
repository_network_format_registry.register_lazy('git',
352
353
    'bzrlib.plugins.git.repository', 'GitRepositoryFormat')
353
354
 
354
355
try:
355
 
    from bzrlib.controldir import (
356
 
        network_format_registry as controldir_network_format_registry,
357
 
        )
358
 
except ImportError:
359
 
    from bzrlib.bzrdir import (
360
 
        network_format_registry as controldir_network_format_registry,
361
 
        )
362
 
controldir_network_format_registry.register('git', GitControlDirFormat)
 
356
    register_extra_lazy_repository_format = getattr(repository_format_registry,
 
357
        "register_extra_lazy")
 
358
except AttributeError: # bzr < 2.4
 
359
    pass
 
360
else:
 
361
    register_extra_lazy_repository_format('bzrlib.plugins.git.repository',
 
362
        'GitRepositoryFormat')
 
363
 
 
364
from bzrlib.branch import (
 
365
    network_format_registry as branch_network_format_registry,
 
366
    )
 
367
branch_network_format_registry.register_lazy('git',
 
368
    'bzrlib.plugins.git.branch', 'GitBranchFormat')
 
369
 
 
370
try:
 
371
    from bzrlib.branch import (
 
372
        format_registry as branch_format_registry,
 
373
        )
 
374
except ImportError: # bzr < 2.4
 
375
    pass
 
376
else:
 
377
    branch_format_registry.register_extra_lazy(
 
378
        'bzrlib.plugins.git.branch',
 
379
        'GitBranchFormat',
 
380
        )
 
381
 
 
382
try:
 
383
    from bzrlib.workingtree import (
 
384
        format_registry as workingtree_format_registry,
 
385
        )
 
386
except ImportError: # bzr < 2.4
 
387
    pass
 
388
else:
 
389
    workingtree_format_registry.register_extra_lazy(
 
390
        'bzrlib.plugins.git.workingtree',
 
391
        'GitWorkingTreeFormat',
 
392
        )
 
393
 
 
394
controldir_network_format_registry.register_lazy('git',
 
395
    "bzrlib.plugins.git.dir", "GitControlDirFormat")
363
396
 
364
397
send_format_registry.register_lazy('git', 'bzrlib.plugins.git.send',
365
398
                                   'send_git', 'Git am-style diff format')
366
399
 
367
 
topic_registry.register_lazy('git',
368
 
                             'bzrlib.plugins.git.help',
369
 
                             'help_git', 'Using Bazaar with Git')
 
400
topic_registry.register_lazy('git', 'bzrlib.plugins.git.help', 'help_git',
 
401
    'Using Bazaar with Git')
 
402
 
 
403
from bzrlib.diff import format_registry as diff_format_registry
 
404
diff_format_registry.register_lazy('git', 'bzrlib.plugins.git.send',
 
405
    'GitDiffTree', 'Git am-style diff format')
 
406
 
 
407
 
 
408
def update_git_cache(repository, revid):
 
409
    """Update the git cache after a local commit."""
 
410
    if getattr(repository, "_git", None) is not None:
 
411
        return # No need to update cache for git repositories
 
412
 
 
413
    if not repository.control_transport.has("git"):
 
414
        return # No existing cache, don't bother updating
 
415
    try:
 
416
        lazy_check_versions()
 
417
    except bzr_errors.DependencyNotPresent, e:
 
418
        # dulwich is probably missing. silently ignore
 
419
        trace.mutter("not updating git map for %r: %s",
 
420
            repository, e)
 
421
 
 
422
    from bzrlib.plugins.git.object_store import BazaarObjectStore
 
423
    store = BazaarObjectStore(repository)
 
424
    store.lock_write()
 
425
    try:
 
426
        parent_revisions = set(repository.get_parent_map([revid])[revid])
 
427
        missing_revisions = store._missing_revisions(parent_revisions)
 
428
        if not missing_revisions:
 
429
            # Only update if the cache was up to date previously
 
430
            store._update_sha_map_revision(revid)
 
431
    finally:
 
432
        store.unlock()
 
433
 
 
434
 
 
435
def post_commit_update_cache(local_branch, master_branch, old_revno, old_revid,
 
436
        new_revno, new_revid):
 
437
    if local_branch is not None:
 
438
        update_git_cache(local_branch.repository, new_revid)
 
439
    update_git_cache(master_branch.repository, new_revid)
 
440
 
 
441
 
 
442
def loggerhead_git_hook(branch_app, environ):
 
443
    from bzrlib.config import GlobalConfig
 
444
    branch = branch_app.branch
 
445
    if GlobalConfig().get_user_option('http_git') != 'True':
 
446
        return None
 
447
    from bzrlib.plugins.git.server import git_http_hook
 
448
    return git_http_hook(branch, environ['REQUEST_METHOD'],
 
449
        environ['PATH_INFO'])
370
450
 
371
451
try:
372
 
    from bzrlib.diff import format_registry as diff_format_registry
373
 
except ImportError:
 
452
    from bzrlib.hooks import install_lazy_named_hook
 
453
except ImportError: # Compatibility with bzr < 2.4
374
454
    pass
375
455
else:
376
 
    diff_format_registry.register_lazy('git', 'bzrlib.plugins.git.send',
377
 
        'GitDiffTree', 'Git am-style diff format')
 
456
    install_lazy_named_hook("bzrlib.branch",
 
457
        "Branch.hooks", "post_commit", post_commit_update_cache,
 
458
        "git cache")
 
459
    install_lazy_named_hook("bzrlib.plugins.loggerhead.apps.branch",
 
460
        "BranchWSGIApp.hooks", "controller",
 
461
        loggerhead_git_hook, "git support")
 
462
 
378
463
 
379
464
def test_suite():
380
465
    from bzrlib.plugins.git import tests