/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

Add simple tests and docstrings for GraphWalker.

Show diffs side-by-side

added added

removed removed

Lines of Context:
113
113
        return self._gitrepository_class(self, self._lockfiles)
114
114
 
115
115
    def open_workingtree(self, recommend_upgrade=True):
116
 
        if self._git.bare:
117
 
            loc = urlutils.unescape_for_display(self.root_transport.base, 'ascii')
118
 
            raise errors.bzr_errors.NoWorkingTree(loc)
119
 
        else:
 
116
        if (not self._git.bare and 
 
117
            os.path.exists(os.path.join(self._git.controldir(), "index"))):
120
118
            return workingtree.GitWorkingTree(self, self.open_repository(), 
121
119
                                                  self.open_branch())
 
120
        loc = urlutils.unescape_for_display(self.root_transport.base, 'ascii')
 
121
        raise errors.bzr_errors.NoWorkingTree(loc)
122
122
 
123
123
    def create_repository(self, shared=False):
124
124
        return self.open_repository()
144
144
        """Open this directory.
145
145
 
146
146
        """
147
 
        from bzrlib.plugins.git import git
 
147
        import dulwich as git
148
148
        # we dont grok readonly - git isn't integrated with transport.
149
149
        url = transport.base
150
150
        if url.startswith('readonly+'):
160
160
    @classmethod
161
161
    def probe_transport(klass, transport):
162
162
        """Our format is present if the transport ends in '.not/'."""
163
 
        from bzrlib.plugins.git import git
 
163
        import dulwich as git
164
164
        # little ugly, but works
165
165
        format = klass()
166
166
        # delegate to the main opening code. This pays a double rtt cost at the
182
182
 
183
183
    def initialize_on_transport(self, transport):
184
184
        from bzrlib.transport.local import LocalTransport
185
 
        from bzrlib.plugins.git import git
 
185
        import dulwich as git
186
186
 
187
187
        if not isinstance(transport, LocalTransport):
188
188
            raise NotImplementedError(self.initialize,