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

Raise proper errors for ghosts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
    ui,
33
33
    )
34
34
 
 
35
from bzrlib.plugins.git.errors import (
 
36
    GhostRevision,
 
37
    )
 
38
 
35
39
from bzrlib.plugins.git.mapping import (
36
40
    default_mapping,
37
41
    directory_to_tree,
158
162
 
159
163
    def _get_commit(self, revid, tree_sha, expected_sha=None):
160
164
        rev = self.repository.get_revision(revid)
161
 
        commit = revision_to_commit(rev, tree_sha, self._lookup_revision_sha1)
 
165
        try:
 
166
            commit = revision_to_commit(rev, tree_sha, self._lookup_revision_sha1)
 
167
        except errors.NoSuchRevision, e:
 
168
            raise GhostRevision(e.branch, e.revision)
162
169
        self._check_expected_sha(expected_sha, commit)
163
170
        return commit
164
171