/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

Merge new dulwich.

Show diffs side-by-side

added added

removed removed

Lines of Context:
74
74
    def is_supported(self):
75
75
        return True
76
76
 
77
 
    def cloning_metadir(self, stacked=False):
78
 
        if stacked:
79
 
            return bzrlib.bzrdir.format_registry.make_bzrdir("pack-0.92")
80
 
        else:
81
 
            return bzrlib.bzrdir.format_registry.make_bzrdir("1.6")
82
 
 
83
77
 
84
78
class LocalGitDir(GitDir):
85
79
    """An adapter to the '.git' dir used by git."""
123
117
            return workingtree.GitWorkingTree(self, self.open_repository(), 
124
118
                                                  self.open_branch())
125
119
 
 
120
    def cloning_metadir(self, stacked=False):
 
121
        if stacked:
 
122
            return bzrlib.bzrdir.format_registry.make_bzrdir("pack-0.92")
 
123
        else:
 
124
            return bzrlib.bzrdir.format_registry.make_bzrdir("1.6")
 
125
 
126
126
    def create_repository(self, shared=False):
127
127
        return self.open_repository()
128
128
 
129
129
 
130
 
class GitBzrDirFormat(bzrdir.BzrDirFormat):
131
 
    _lock_class = TransportLock
132
 
 
133
 
    def is_supported(self):
134
 
        return True
135
 
 
136
 
 
137
 
class LocalGitBzrDirFormat(GitBzrDirFormat):
 
130
class LocalGitBzrDirFormat(bzrdir.BzrDirFormat):
138
131
    """The .git directory control format."""
139
132
 
140
133
    _gitdir_class = LocalGitDir
 
134
    _lock_class = TransportLock
141
135
 
142
136
    @classmethod
143
137
    def _known_formats(self):
163
157
    @classmethod
164
158
    def probe_transport(klass, transport):
165
159
        """Our format is present if the transport ends in '.not/'."""
166
 
        from bzrlib.plugins.git import git
167
160
        # little ugly, but works
168
161
        format = klass()
169
162
        # delegate to the main opening code. This pays a double rtt cost at the
173
166
        try:
174
167
            format.open(transport)
175
168
            return format
176
 
        except git.errors.NotGitRepository, e:
 
169
        except Exception, e:
177
170
            raise errors.bzr_errors.NotBranchError(path=transport.base)
178
171
        raise errors.bzr_errors.NotBranchError(path=transport.base)
179
172
 
199
192
        return True
200
193
 
201
194
 
202
 
class RemoteGitBzrDirFormat(GitBzrDirFormat):
 
195
class RemoteGitBzrDirFormat(bzrdir.BzrDirFormat):
203
196
    """The .git directory control format."""
204
197
 
 
198
    _lock_class = TransportLock
 
199
 
205
200
    @classmethod
206
201
    def _known_formats(self):
207
202
        return set([RemoteGitBzrDirFormat()])
249
244
    def initialize_on_transport(self, transport):
250
245
        raise errors.bzr_errors.UninitializableFormat(self)
251
246
 
 
247
    def is_supported(self):
 
248
        return True