~jelmer/bzr-git/trunk

« back to all changes in this revision

Viewing changes to __init__.py

  • Committer: Jelmer Vernooij
  • Date: 2017-06-11 02:17:08 UTC
  • Revision ID: jelmer@jelmer.uk-20170611021708-j8i00px049iaxhor
Use __name__.

Show diffs side-by-side

added added

removed removed

Lines of Context:
251
251
register_transport_proto('git+ssh://',
252
252
        help="Access using the Git smart server protocol over SSH.")
253
253
 
254
 
register_lazy_transport("git://", 'bzrlib.plugins.git.remote',
 
254
register_lazy_transport("git://", __name__ + '.remote',
255
255
                        'TCPGitSmartTransport')
256
 
register_lazy_transport("git+ssh://", 'bzrlib.plugins.git.remote',
 
256
register_lazy_transport("git+ssh://", __name__ + '.remote',
257
257
                        'SSHGitSmartTransport')
258
258
 
259
259
 
260
 
plugin_cmds.register_lazy("cmd_git_import", [], "bzrlib.plugins.git.commands")
 
260
plugin_cmds.register_lazy("cmd_git_import", [], __name__ + ".commands")
261
261
plugin_cmds.register_lazy("cmd_git_object", ["git-objects", "git-cat"],
262
 
    "bzrlib.plugins.git.commands")
263
 
plugin_cmds.register_lazy("cmd_git_refs", [], "bzrlib.plugins.git.commands")
264
 
plugin_cmds.register_lazy("cmd_git_apply", [], "bzrlib.plugins.git.commands")
 
262
    __name__ + ".commands")
 
263
plugin_cmds.register_lazy("cmd_git_refs", [], __name__ + ".commands")
 
264
plugin_cmds.register_lazy("cmd_git_apply", [], __name__ + ".commands")
265
265
plugin_cmds.register_lazy("cmd_git_push_pristine_tar_deltas",
266
266
        ['git-push-pristine-tar', 'git-push-pristine'],
267
 
    "bzrlib.plugins.git.commands")
 
267
    __name__ + ".commands")
268
268
 
269
269
def extract_git_foreign_revid(rev):
270
270
    try:
298
298
 
299
299
 
300
300
transport_server_registry.register_lazy('git',
301
 
    'bzrlib.plugins.git.server',
 
301
    __name__ + '.server',
302
302
    'serve_git',
303
303
    'Git Smart server protocol over TCP. (default port: 9418)')
304
304
 
305
305
transport_server_registry.register_lazy('git-receive-pack',
306
 
    'bzrlib.plugins.git.server',
 
306
    __name__ + '.server',
307
307
    'serve_git_receive_pack',
308
308
    help='Git Smart server receive pack command. (inetd mode only)')
309
309
transport_server_registry.register_lazy('git-upload-pack',
310
 
    'bzrlib.plugins.git.server',
 
310
    __name__ + 'git.server',
311
311
    'serve_git_upload_pack',
312
312
    help='Git Smart server upload pack command. (inetd mode only)')
313
313
 
316
316
    network_format_registry as repository_network_format_registry,
317
317
    )
318
318
repository_network_format_registry.register_lazy('git',
319
 
    'bzrlib.plugins.git.repository', 'GitRepositoryFormat')
 
319
    __name__ + '.repository', 'GitRepositoryFormat')
320
320
 
321
321
register_extra_lazy_repository_format = getattr(repository_format_registry,
322
322
    "register_extra_lazy")
323
 
register_extra_lazy_repository_format('bzrlib.plugins.git.repository',
 
323
register_extra_lazy_repository_format(__name__ + '.repository',
324
324
    'GitRepositoryFormat')
325
325
 
326
326
from ...branch import (
327
327
    network_format_registry as branch_network_format_registry,
328
328
    )
329
329
branch_network_format_registry.register_lazy('git',
330
 
    'bzrlib.plugins.git.branch', 'GitBranchFormat')
 
330
    __name__ + '.branch', 'GitBranchFormat')
331
331
 
332
332
from ...branch import (
333
333
    format_registry as branch_format_registry,
334
334
    )
335
335
branch_format_registry.register_extra_lazy(
336
 
    'bzrlib.plugins.git.branch',
 
336
    __name__ + '.branch',
337
337
    'GitBranchFormat',
338
338
    )
339
339
 
341
341
    format_registry as workingtree_format_registry,
342
342
    )
343
343
workingtree_format_registry.register_extra_lazy(
344
 
    'bzrlib.plugins.git.workingtree',
 
344
    __name__ + '.workingtree',
345
345
    'GitWorkingTreeFormat',
346
346
    )
347
347
 
348
348
controldir_network_format_registry.register_lazy('git',
349
 
    "bzrlib.plugins.git.dir", "GitControlDirFormat")
 
349
    __name__ + ".dir", "GitControlDirFormat")
350
350
 
351
351
 
352
352
try:
353
353
    from ...registry import register_lazy
354
354
except ImportError:
355
355
    from ...diff import format_registry as diff_format_registry
356
 
    diff_format_registry.register_lazy('git', 'bzrlib.plugins.git.send',
 
356
    diff_format_registry.register_lazy('git', __name__ + '.send',
357
357
        'GitDiffTree', 'Git am-style diff format')
358
358
 
359
359
    from ...send import (
360
360
        format_registry as send_format_registry,
361
361
        )
362
 
    send_format_registry.register_lazy('git', 'bzrlib.plugins.git.send',
 
362
    send_format_registry.register_lazy('git', __name__ + '.send',
363
363
                                       'send_git', 'Git am-style diff format')
364
364
 
365
365
    from ...directory_service import directories
366
 
    directories.register_lazy('github:', 'bzrlib.plugins.git.directory',
 
366
    directories.register_lazy('github:', __name__ + '.directory',
367
367
                              'GitHubDirectory',
368
368
                              'GitHub directory.')
369
 
    directories.register_lazy('git@github.com:', 'bzrlib.plugins.git.directory',
 
369
    directories.register_lazy('git@github.com:', __name__ + '.directory',
370
370
                              'GitHubDirectory',
371
371
                              'GitHub directory.')
372
372
 
373
373
    from ...help_topics import (
374
374
        topic_registry,
375
375
        )
376
 
    topic_registry.register_lazy('git', 'bzrlib.plugins.git.help', 'help_git',
 
376
    topic_registry.register_lazy('git', __name__ + '.help', 'help_git',
377
377
        'Using Bazaar with Git')
378
378
 
379
379
    from ...foreign import (
380
380
        foreign_vcs_registry,
381
381
        )
382
382
    foreign_vcs_registry.register_lazy("git",
383
 
        "bzrlib.plugins.git.mapping", "foreign_vcs_git", "Stupid content tracker")
 
383
        __name__ + ".mapping", "foreign_vcs_git", "Stupid content tracker")
384
384
else:
385
385
    register_lazy("bzrlib.diff", "format_registry",
386
 
        'git', 'bzrlib.plugins.git.send', 'GitDiffTree',
 
386
        'git', __name__ + '.send', 'GitDiffTree',
387
387
        'Git am-style diff format')
388
388
    register_lazy("bzrlib.send", "format_registry",
389
 
        'git', 'bzrlib.plugins.git.send', 'send_git',
 
389
        'git', __name__ + '.send', 'send_git',
390
390
        'Git am-style diff format')
391
391
    register_lazy('bzrlib.directory_service', 'directories', 'github:',
392
 
            'bzrlib.plugins.git.directory', 'GitHubDirectory',
 
392
            __name__ + '.directory', 'GitHubDirectory',
393
393
            'GitHub directory.')
394
394
    register_lazy('bzrlib.directory_service', 'directories',
395
395
            'git@github.com:', 'bzrlib.plugins.git.directory',
396
396
            'GitHubDirectory', 'GitHub directory.')
397
397
    register_lazy('bzrlib.help_topics', 'topic_registry',
398
 
            'git', 'bzrlib.plugins.git.help', 'help_git',
 
398
            'git', __name__ + '.help', 'help_git',
399
399
            'Using Bazaar with Git')
400
400
    register_lazy('bzrlib.foreign', 'foreign_vcs_registry', "git",
401
 
        "bzrlib.plugins.git.mapping", "foreign_vcs_git", "Stupid content tracker")
 
401
        __name__ + ".mapping", "foreign_vcs_git", "Stupid content tracker")
402
402
 
403
403
def update_git_cache(repository, revid):
404
404
    """Update the git cache after a local commit."""