/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 dir.py

Eliminate (duplicate) git_ prefix.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
"""An adapter between a Git control dir and a Bazaar BzrDir"""
18
18
 
19
 
import git, os
 
19
import git
20
20
 
21
 
import bzrlib
22
21
from bzrlib.lazy_import import lazy_import
23
22
from bzrlib import (
24
23
    bzrdir,
27
26
    )
28
27
 
29
28
lazy_import(globals(), """
30
 
from bzrlib.lockable_files import TransportLock
31
29
from bzrlib.plugins.git import (
32
30
    errors,
33
31
    branch,
113
111
            return workingtree.GitWorkingTree(self, self.open_repository(), 
114
112
                                                  self.open_branch())
115
113
 
116
 
    def cloning_metadir(self, stacked=False):
117
 
        if stacked:
118
 
            return bzrlib.bzrdir.format_registry.make_bzrdir("pack-0.92")
119
 
        else:
120
 
            return bzrlib.bzrdir.format_registry.make_bzrdir("1.6")
121
 
 
122
 
    def create_repository(self, shared=False):
123
 
        return self.open_repository()
 
114
    def cloning_metadir(self):
 
115
        return bzrdir.BzrDirFormat.get_default_format()
124
116
 
125
117
 
126
118
class GitBzrDirFormat(bzrdir.BzrDirFormat):
127
119
    """The .git directory control format."""
128
120
 
129
121
    _gitdir_class = GitDir
130
 
    _lock_class = TransportLock
131
122
 
132
123
    @classmethod
133
124
    def _known_formats(self):
168
159
    def get_format_description(self):
169
160
        return "Local Git Repository"
170
161
 
171
 
    def get_format_string(self):
172
 
        return "Local Git Repository"
173
 
 
174
 
    def initialize_on_transport(self, transport):
175
 
        from bzrlib.transport.local import LocalTransport
176
 
 
177
 
        if not isinstance(transport, LocalTransport):
178
 
            raise NotImplementedError(self.initialize, 
179
 
                "Can't create Git Repositories/branches on "
180
 
                "non-local transports")
181
 
 
182
 
        git.repo.Repo.create(transport.local_abspath(".")) 
183
 
        return self.open(transport)
184
 
 
185
162
 
186
163
bzrdir.BzrDirFormat.register_control_format(GitBzrDirFormat)