/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 workingtree.py

  • Committer: Jelmer Vernooij
  • Date: 2010-03-23 13:42:21 UTC
  • mto: (0.254.18 index-based)
  • mto: This revision was merged to the branch mainline in revision 6960.
  • Revision ID: jelmer@samba.org-20100323134221-rvvafw3oizl5rl1f
Handle working trees without valid HEAD branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
171
171
 
172
172
    def _reset_data(self):
173
173
        self._inventory_is_modified = False
174
 
        basis_inv = self.repository.get_inventory(self.mapping.revision_id_foreign_to_bzr(self.repository._git.head()))
 
174
        try:
 
175
            head = self.repository._git.head()
 
176
        except KeyError, name:
 
177
            raise errors.NotBranchError("branch %s at %s" % (name, self.repository.base))
 
178
        basis_inv = self.repository.get_inventory(self.mapping.revision_id_foreign_to_bzr(head))
175
179
        result = GitIndexInventory(basis_inv, self.mapping, self.index,
176
180
            self.repository._git.object_store)
177
181
        self._set_inventory(result, dirty=False)