/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

Rename BzrDir to ControlDir.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
 
44
44
 
45
45
from bzrlib import (
46
 
    bzrdir,
47
46
    errors as bzr_errors,
48
47
    osutils,
49
48
    )
 
49
try:
 
50
    from bzrlib.controldir import (
 
51
        ControlDirFormat,
 
52
        ControlDir,
 
53
        format_registry,
 
54
        )
 
55
except ImportError:
 
56
    # bzr < 2.3
 
57
    from bzrlib.bzrdir import (
 
58
        BzrDirFormat,
 
59
        BzrDir,
 
60
        format_registry,
 
61
        )
 
62
    ControlDir = BzrDir
 
63
    ControlDirFormat = BzrDirFormat
 
64
 
50
65
from bzrlib.foreign import (
51
66
    foreign_vcs_registry,
52
67
    )
98
113
    import_dulwich()
99
114
    _versions_checked = True
100
115
 
101
 
bzrdir.format_registry.register_lazy('git',
102
 
    "bzrlib.plugins.git.dir", "LocalGitBzrDirFormat",
 
116
format_registry.register_lazy('git',
 
117
    "bzrlib.plugins.git.dir", "LocalGitControlDirFormat",
103
118
    help='GIT repository.', native=False, experimental=True,
104
119
    )
105
120
 
116
131
    dwim_revspecs.append(RevisionSpec_git)
117
132
 
118
133
 
119
 
class GitBzrDirFormat(bzrdir.BzrDirFormat):
 
134
class GitControlDirFormat(ControlDirFormat):
120
135
 
121
136
    _lock_class = TransportLock
122
137
 
132
147
        return "git"
133
148
 
134
149
 
135
 
class LocalGitBzrDirFormat(GitBzrDirFormat):
 
150
class LocalGitControlDirFormat(GitControlDirFormat):
136
151
    """The .git directory control format."""
137
152
 
138
153
    @classmethod
139
154
    def _known_formats(self):
140
 
        return set([LocalGitBzrDirFormat()])
 
155
        return set([LocalGitControlDirFormat()])
141
156
 
142
157
    def open(self, transport, _found=None):
143
158
        """Open this directory.
193
208
        return True
194
209
 
195
210
 
196
 
class RemoteGitBzrDirFormat(GitBzrDirFormat):
 
211
class RemoteGitControlDirFormat(GitControlDirFormat):
197
212
    """The .git directory control format."""
198
213
 
199
214
    @classmethod
200
215
    def _known_formats(self):
201
 
        return set([RemoteGitBzrDirFormat()])
 
216
        return set([RemoteGitControlDirFormat()])
202
217
 
203
218
    def open(self, transport, _found=None):
204
219
        """Open this directory.
242
257
        raise bzr_errors.UninitializableFormat(self)
243
258
 
244
259
 
245
 
bzrdir.BzrDirFormat.register_control_format(LocalGitBzrDirFormat)
246
 
bzrdir.BzrDirFormat.register_control_format(RemoteGitBzrDirFormat)
 
260
ControlDirFormat.register_control_format(LocalGitControlDirFormat)
 
261
ControlDirFormat.register_control_format(RemoteGitControlDirFormat)
247
262
 
248
263
register_transport_proto('git://',
249
264
        help="Access using the Git smart server protocol.")
291
306
from bzrlib.bzrdir import (
292
307
    network_format_registry as bzrdir_network_format_registry,
293
308
    )
294
 
bzrdir_network_format_registry.register('git', GitBzrDirFormat)
 
309
bzrdir_network_format_registry.register('git', GitControlDirFormat)
295
310
 
296
311
send_format_registry.register_lazy('git', 'bzrlib.plugins.git.send',
297
312
                                   'send_git', 'Git am-style diff format')