/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 some basic documentation in 'bzr help git'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
from bzrlib.foreign import (
51
51
    foreign_vcs_registry,
52
52
    )
 
53
from bzrlib.help_topics import (
 
54
    topic_registry,
 
55
    )
53
56
from bzrlib.lockable_files import (
54
57
    TransportLock,
55
58
    )
73
76
    sys.path.append(os.path.normpath(
74
77
        os.path.join(os.path.dirname(__file__), '_lib')))
75
78
 
76
 
_versions_checked = False
77
 
def lazy_check_versions():
78
 
    global _versions_checked
79
 
    if _versions_checked:
80
 
        return
81
 
    _versions_checked = True
 
79
 
 
80
def import_dulwich():
82
81
    try:
83
82
        from dulwich import __version__ as dulwich_version
84
83
    except ImportError:
90
89
                "bzr-git: Dulwich is too old; at least %d.%d.%d is required" %
91
90
                    dulwich_minimum_version)
92
91
 
 
92
 
 
93
_versions_checked = False
 
94
def lazy_check_versions():
 
95
    global _versions_checked
 
96
    if _versions_checked:
 
97
        return
 
98
    import_dulwich()
 
99
    _versions_checked = True
 
100
 
93
101
bzrdir.format_registry.register_lazy('git',
94
102
    "bzrlib.plugins.git.dir", "LocalGitBzrDirFormat",
95
103
    help='GIT repository.', native=False, experimental=True,
114
122
 
115
123
    colocated_branches = True
116
124
 
 
125
    def __eq__(self, other):
 
126
        return type(self) == type(other)
 
127
 
117
128
    def is_supported(self):
118
129
        return True
119
130
 
133
144
 
134
145
        """
135
146
        lazy_check_versions()
136
 
        # we dont grok readonly - git isn't integrated with transport.
137
 
        from bzrlib.transport.local import LocalTransport
138
 
        if isinstance(transport, LocalTransport):
139
 
            import dulwich
140
 
            path = transport.local_abspath(".").encode(osutils._fs_enc)
141
 
            gitrepo = dulwich.repo.Repo(path)
142
 
        else:
143
 
            from bzrlib.plugins.git.transportgit import TransportRepo
144
 
            gitrepo = TransportRepo(transport)
 
147
        from bzrlib.plugins.git.transportgit import TransportRepo
 
148
        gitrepo = TransportRepo(transport)
145
149
        from bzrlib.plugins.git.dir import LocalGitDir, GitLockableFiles, GitLock
146
150
        lockfiles = GitLockableFiles(transport, GitLock())
147
151
        return LocalGitDir(transport, lockfiles, gitrepo, self)
292
296
send_format_registry.register_lazy('git', 'bzrlib.plugins.git.send',
293
297
                                   'send_git', 'Git am-style diff format')
294
298
 
 
299
topic_registry.register_lazy('git',
 
300
                             'bzrlib.plugins.git.help',
 
301
                             'help_git', 'Using Bazaar with Git')
 
302
 
295
303
try:
296
304
    from bzrlib.diff import format_registry as diff_format_registry
297
305
except ImportError: