/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

Properly check that matching bzr objects exist.

Show diffs side-by-side

added added

removed removed

Lines of Context:
214
214
    def __contains__(self, sha):
215
215
        # See if sha is in map
216
216
        try:
217
 
            self._lookup_git_sha(sha)
 
217
            (type, type_data) = self._lookup_git_sha(sha)
 
218
            if type == "commit":
 
219
                return self.repository.has_revision(type_data[0])
 
220
            elif type == "blob":
 
221
                return self.repository.texts.has_version(type_data)
 
222
            elif type == "tree":
 
223
                return self.repository.has_revision(type_data[1])
 
224
            else:
 
225
                raise AssertionError("Unknown object type '%s'" % type)
218
226
        except KeyError:
219
227
            return False
220
228
        else: