~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: John Arbash Meinel
  • Date: 2009-12-01 21:27:08 UTC
  • mto: This revision was merged to the branch mainline in revision 4887.
  • Revision ID: john@arbash-meinel.com-20091201212708-bjlq7ydk7xtmzuhd
Add a flag that controls if we will return InventoryEntries from the cache.

Setting this to true makes conversion a lot faster, but isn't safe to do
all the time, as callers might mutate the returned object.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3840
3840
        pending_revisions = []
3841
3841
        parent_map = self.source.get_parent_map(revision_ids)
3842
3842
        self._fetch_parent_invs_for_stacking(parent_map, cache)
 
3843
        self.source._format._serializer.safe_to_use_cache_items = True
3843
3844
        for tree in self.source.revision_trees(revision_ids):
3844
3845
            # Find a inventory delta for this revision.
3845
3846
            # Find text entries that need to be copied, too.
3893
3894
            pending_revisions.append(revision)
3894
3895
            cache[current_revision_id] = tree
3895
3896
            basis_id = current_revision_id
 
3897
        self.source._format._serializer.safe_to_use_cache_items = False
3896
3898
        # Copy file texts
3897
3899
        from_texts = self.source.texts
3898
3900
        to_texts = self.target.texts
3977
3979
                basis_id = self._fetch_batch(batch, basis_id, cache,
3978
3980
                                             a_graph=a_graph)
3979
3981
            except:
 
3982
                self.source._format._serializer.safe_to_use_cache_items = False
3980
3983
                self.target.abort_write_group()
3981
3984
                raise
3982
3985
            else: