/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

Prevent deep recursion if the shamap is out of date.

Show diffs side-by-side

added added

removed removed

Lines of Context:
98
98
        tree_sha = self._get_ie_sha1(inv.root, inv)
99
99
        rev = self.repository.get_revision(revid)
100
100
        commit_obj = revision_to_commit(rev, tree_sha,
101
 
            self._idmap._parent_lookup)
 
101
                                        self._idmap.lookup_commit)
102
102
        try:
103
103
            foreign_revid, mapping = mapping_registry.parse_revision_id(revid)
104
104
        except errors.InvalidRevisionId:
185
185
    def _lookup_revision_sha1(self, revid):
186
186
        """Return the SHA1 matching a Bazaar revision."""
187
187
        try:
188
 
            return self._idmap._parent_lookup(revid)
 
188
            return self._idmap.lookup_commit(revid)
189
189
        except KeyError:
190
 
            inv = self.repository.get_inventory(revid)
191
 
            tree_sha = self._get_ie_sha1(inv.root, inv)
192
 
            ret = self._get_commit(revid, tree_sha).id
193
 
            self._idmap.add_entry(ret, "commit", (revid, tree_sha))
194
 
            return ret
 
190
            self._update_sha_map(revid)
 
191
            return self._idmap.lookup_commit(revid)
195
192
 
196
193
    def get_raw(self, sha):
197
194
        """Get the raw representation of a Git object by SHA1.