~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/fetch.py

  • Committer: Robert J. Tanner
  • Date: 2009-04-29 05:53:21 UTC
  • mfrom: (4311 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4312.
  • Revision ID: tanner@real-time.com-20090429055321-v2s5l1mgki9f6cgn
[merge] 1.14 back to trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
137
137
            resume_tokens, missing_keys = self.sink.insert_stream(
138
138
                stream, from_format, [])
139
139
            if self.to_repository._fallback_repositories:
140
 
                # Find all the parent revisions referenced by the stream, but
141
 
                # not present in the stream, and make sure we have their
142
 
                # inventories.
143
 
                revision_ids = search.get_keys()
144
 
                parent_maps = self.to_repository.get_parent_map(revision_ids)
145
 
                parents = set()
146
 
                map(parents.update, parent_maps.itervalues())
147
 
                parents.difference_update(revision_ids)
148
 
                parents.discard(NULL_REVISION)
149
140
                missing_keys.update(
150
 
                    ('inventories', rev_id) for rev_id in parents)
 
141
                    self._parent_inventories(search.get_keys()))
151
142
            if missing_keys:
152
143
                pb.update("Missing keys")
153
144
                stream = source.get_stream_for_missing_keys(missing_keys)
189
180
        except errors.NoSuchRevision, e:
190
181
            raise InstallFailed([self._last_revision])
191
182
 
 
183
    def _parent_inventories(self, revision_ids):
 
184
        # Find all the parent revisions referenced by the stream, but
 
185
        # not present in the stream, and make sure we send their
 
186
        # inventories.
 
187
        parent_maps = self.to_repository.get_parent_map(revision_ids)
 
188
        parents = set()
 
189
        map(parents.update, parent_maps.itervalues())
 
190
        parents.discard(NULL_REVISION)
 
191
        parents.difference_update(revision_ids)
 
192
        missing_keys = set(('inventories', rev_id) for rev_id in parents)
 
193
        return missing_keys
 
194
 
192
195
 
193
196
class Inter1and2Helper(object):
194
197
    """Helper for operations that convert data from model 1 and 2