/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

  • Committer: Jelmer Vernooij
  • Date: 2010-02-12 00:39:11 UTC
  • mto: (0.200.718 trunk)
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@samba.org-20100212003911-hz63ctlfgsvrzrjh
Cope with has_index not existing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
122
122
        return self._gitrepository_class(self, self._lockfiles)
123
123
 
124
124
    def open_workingtree(self, recommend_upgrade=True):
125
 
        if not self._git.bare and self._git.has_index():
126
 
            from bzrlib.plugins.git.workingtree import GitWorkingTree
127
 
            return GitWorkingTree(self, self.open_repository(),
128
 
                                                  self.open_branch())
 
125
        if not self._git.bare:
 
126
            from dulwich.errors import NoIndexPresent
 
127
            try:
 
128
                from bzrlib.plugins.git.workingtree import GitWorkingTree
 
129
                return GitWorkingTree(self, self.open_repository(),
 
130
                                                      self.open_branch())
 
131
            except NoIndexPresent:
 
132
                pass
129
133
        loc = urlutils.unescape_for_display(self.root_transport.base, 'ascii')
130
134
        raise bzr_errors.NoWorkingTree(loc)
131
135