/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

Merge http support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
128
128
 
129
129
        """
130
130
        lazy_check_versions()
131
 
        import dulwich
132
131
        # we dont grok readonly - git isn't integrated with transport.
133
 
        url = transport.base
134
 
        if url.startswith('readonly+'):
135
 
            url = url[len('readonly+'):]
136
 
 
137
 
        try:
 
132
        from bzrlib.transport.local import LocalTransport
 
133
        if isinstance(transport, LocalTransport):
 
134
            import dulwich
138
135
            gitrepo = dulwich.repo.Repo(transport.local_abspath(".").encode(osutils._fs_enc))
139
 
        except bzr_errors.NotLocalUrl:
140
 
            raise bzr_errors.NotBranchError(path=transport.base)
 
136
        else:
 
137
            from bzrlib.plugins.git.transportgit import TransportRepo
 
138
            gitrepo = TransportRepo(transport)
141
139
        from bzrlib.plugins.git.dir import LocalGitDir, GitLockableFiles, GitLock
142
140
        lockfiles = GitLockableFiles(transport, GitLock())
143
141
        return LocalGitDir(transport, lockfiles, gitrepo, self)
144
142
 
145
143
    @classmethod
146
144
    def probe_transport(klass, transport):
147
 
        """Our format is present if the transport ends in '.not/'."""
148
 
        from bzrlib.transport.local import LocalTransport
149
 
 
150
 
        if not isinstance(transport, LocalTransport):
151
 
            raise bzr_errors.NotBranchError(path=transport.base)
152
 
 
153
 
        # This should quickly filter out most things that are not
154
 
        # git repositories, saving us the trouble from loading dulwich.
155
 
        if not transport.has(".git") and not transport.has("objects"):
156
 
            raise bzr_errors.NotBranchError(path=transport.base)
157
 
 
158
145
        lazy_check_versions()
159
146
        import dulwich
160
147
        format = klass()