/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

Make remote repository access a bit lazier.

Show diffs side-by-side

added added

removed removed

Lines of Context:
177
177
        """Open this directory.
178
178
 
179
179
        """
 
180
        # we dont grok readonly - git isn't integrated with transport.
 
181
        url = transport.base
 
182
        if url.startswith('readonly+'):
 
183
            url = url[len('readonly+'):]
 
184
        if (not url.startswith("git://") and 
 
185
            not url.startswith("git+")):
 
186
            raise bzr_errors.NotBranchError(transport.base)
180
187
        from bzrlib.plugins.git.remote import RemoteGitDir, GitSmartTransport
181
188
        if not isinstance(transport, GitSmartTransport):
182
189
            raise bzr_errors.NotBranchError(transport.base)
183
 
        # we dont grok readonly - git isn't integrated with transport.
184
 
        url = transport.base
185
 
        if url.startswith('readonly+'):
186
 
            url = url[len('readonly+'):]
187
 
 
188
190
        from bzrlib.plugins.git.dir import GitLockableFiles, GitLock
189
191
        lockfiles = GitLockableFiles(transport, GitLock())
190
192
        return RemoteGitDir(transport, lockfiles, self)
192
194
    @classmethod
193
195
    def probe_transport(klass, transport):
194
196
        """Our format is present if the transport ends in '.not/'."""
 
197
        url = transport.base
 
198
        if url.startswith('readonly+'):
 
199
            url = url[len('readonly+'):]
 
200
        if (not url.startswith("git://") and 
 
201
            not url.startswith("git+")):
 
202
            raise bzr_errors.NotBranchError(transport.base)
195
203
        # little ugly, but works
196
204
        format = klass()
197
205
        from bzrlib.plugins.git.remote import GitSmartTransport