/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

Fix formatting, remove catch-all for exceptions when opening local repositories.

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
 
        return bzrlib.bzrdir.format_registry.make_bzrdir("1.9-rich-root")
 
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")
79
82
 
80
83
 
81
84
class LocalGitDir(GitDir):
113
116
        return self._gitrepository_class(self, self._lockfiles)
114
117
 
115
118
    def open_workingtree(self, recommend_upgrade=True):
116
 
        if (not self._git.bare and 
117
 
            os.path.exists(os.path.join(self._git.controldir(), "index"))):
 
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:
118
123
            return workingtree.GitWorkingTree(self, self.open_repository(), 
119
124
                                                  self.open_branch())
120
 
        loc = urlutils.unescape_for_display(self.root_transport.base, 'ascii')
121
 
        raise errors.bzr_errors.NoWorkingTree(loc)
122
125
 
123
126
    def create_repository(self, shared=False):
124
127
        return self.open_repository()
231
234
        try:
232
235
            transport.fetch_pack(lambda x: [], None, lambda x: None, 
233
236
                                 lambda x: mutter("git: %s" % x))
234
 
        except errors.git_errors.GitProtocolError:
 
237
        except GitProtocolException, e:
235
238
            raise errors.bzr_errors.NotBranchError(path=transport.base)
236
239
        else:
237
240
            return format