~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

(spiv) Remove redundant parent inventories calculation during fetch. (Andrew
 Bennetts)

Show diffs side-by-side

added added

removed removed

Lines of Context:
125
125
            pb.update("Inserting stream")
126
126
            resume_tokens, missing_keys = self.sink.insert_stream(
127
127
                stream, from_format, [])
128
 
            if self.to_repository._fallback_repositories:
129
 
                missing_keys.update(
130
 
                    self._parent_inventories(search.get_keys()))
131
128
            if missing_keys:
132
129
                pb.update("Missing keys")
133
130
                stream = source.get_stream_for_missing_keys(missing_keys)
163
160
            self.from_repository, self._last_revision,
164
161
            find_ghosts=self.find_ghosts)
165
162
 
166
 
    def _parent_inventories(self, revision_ids):
167
 
        # Find all the parent revisions referenced by the stream, but
168
 
        # not present in the stream, and make sure we send their
169
 
        # inventories.
170
 
        parent_maps = self.to_repository.get_parent_map(revision_ids)
171
 
        parents = set()
172
 
        map(parents.update, parent_maps.itervalues())
173
 
        parents.discard(NULL_REVISION)
174
 
        parents.difference_update(revision_ids)
175
 
        missing_keys = set(('inventories', rev_id) for rev_id in parents)
176
 
        return missing_keys
177
 
 
178
163
 
179
164
class Inter1and2Helper(object):
180
165
    """Helper for operations that convert data from model 1 and 2