/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

Actually use shagitmap again to look up trees.

Show diffs side-by-side

added added

removed removed

Lines of Context:
155
155
 
156
156
    def _get_ie_object_or_sha1(self, entry, inv, unusual_modes):
157
157
        if entry.kind == "directory":
158
 
            ret = self._get_ie_object(entry, inv, unusual_modes)
159
 
            if ret is None:
160
 
                # Empty directory
161
 
                hexsha = None
162
 
            else:
163
 
                hexsha = ret.id
164
 
            self._idmap.add_entry(hexsha, "tree",
165
 
                (entry.file_id, inv.revision_id))
166
 
            return hexsha, ret
 
158
            try:
 
159
                return self._idmap.lookup_tree(entry.file_id, inv.revision_id), None
 
160
            except (KeyError, NotImplementedError):
 
161
                ret = self._get_ie_object(entry, inv, unusual_modes)
 
162
                if ret is None:
 
163
                    # Empty directory
 
164
                    hexsha = None
 
165
                else:
 
166
                    hexsha = ret.id
 
167
                self._idmap.add_entry(hexsha, "tree",
 
168
                    (entry.file_id, inv.revision_id))
 
169
                return hexsha, ret
167
170
        elif entry.kind in ("file", "symlink"):
168
171
            try:
169
172
                return self._idmap.lookup_blob(entry.file_id, entry.revision), None