/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

Return mapping in revision_id_bzr_to_foreign() as required by the interface.

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
        return True
76
76
 
77
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")
 
78
        return bzrlib.bzrdir.format_registry.make_bzrdir("1.9-rich-root")
82
79
 
83
80
 
84
81
class LocalGitDir(GitDir):
116
113
        return self._gitrepository_class(self, self._lockfiles)
117
114
 
118
115
    def open_workingtree(self, recommend_upgrade=True):
119
 
        if self._git.bare:
120
 
            loc = urlutils.unescape_for_display(self.root_transport.base, 'ascii')
121
 
            raise errors.bzr_errors.NoWorkingTree(loc)
122
 
        else:
 
116
        if (not self._git.bare and 
 
117
            os.path.exists(os.path.join(self._git.controldir(), "index"))):
123
118
            return workingtree.GitWorkingTree(self, self.open_repository(), 
124
119
                                                  self.open_branch())
 
120
        loc = urlutils.unescape_for_display(self.root_transport.base, 'ascii')
 
121
        raise errors.bzr_errors.NoWorkingTree(loc)
125
122
 
126
123
    def create_repository(self, shared=False):
127
124
        return self.open_repository()
147
144
        """Open this directory.
148
145
 
149
146
        """
150
 
        from bzrlib.plugins.git import git
 
147
        import dulwich as git
151
148
        # we dont grok readonly - git isn't integrated with transport.
152
149
        url = transport.base
153
150
        if url.startswith('readonly+'):
163
160
    @classmethod
164
161
    def probe_transport(klass, transport):
165
162
        """Our format is present if the transport ends in '.not/'."""
166
 
        from bzrlib.plugins.git import git
 
163
        import dulwich as git
167
164
        # little ugly, but works
168
165
        format = klass()
169
166
        # delegate to the main opening code. This pays a double rtt cost at the
185
182
 
186
183
    def initialize_on_transport(self, transport):
187
184
        from bzrlib.transport.local import LocalTransport
188
 
        from bzrlib.plugins.git import git
 
185
        import dulwich as git
189
186
 
190
187
        if not isinstance(transport, LocalTransport):
191
188
            raise NotImplementedError(self.initialize, 
234
231
        try:
235
232
            transport.fetch_pack(lambda x: [], None, lambda x: None, 
236
233
                                 lambda x: mutter("git: %s" % x))
237
 
        except GitProtocolException, e:
 
234
        except errors.git_errors.GitProtocolError:
238
235
            raise errors.bzr_errors.NotBranchError(path=transport.base)
239
236
        else:
240
237
            return format