~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/serializer/v4.py

  • Committer: Ian Clatworthy
  • Date: 2009-03-20 04:22:44 UTC
  • mfrom: (3368.2.54 bzr.content-filters)
  • mto: This revision was merged to the branch mainline in revision 4173.
  • Revision ID: ian.clatworthy@canonical.com-20090320042244-xwqpk6gc4t9y9pbi
Content filters (Ian Clatworthy)

Show diffs side-by-side

added added

removed removed

Lines of Context:
270
270
        self.repository = repository
271
271
        bundle = BundleWriter(fileobj)
272
272
        self.bundle = bundle
273
 
        self.base_ancestry = set(repository.get_ancestry(base,
274
 
                                                         topo_sorted=False))
275
273
        if revision_ids is not None:
276
274
            self.revision_ids = revision_ids
277
275
        else:
278
 
            revision_ids = set(repository.get_ancestry(target,
279
 
                                                       topo_sorted=False))
280
 
            self.revision_ids = revision_ids.difference(self.base_ancestry)
 
276
            graph = repository.get_graph()
 
277
            revision_ids = graph.find_unique_ancestors(target, [base])
 
278
            # Strip ghosts
 
279
            parents = graph.get_parent_map(revision_ids)
 
280
            self.revision_ids = [r for r in revision_ids if r in parents]
281
281
        self.revision_keys = set([(revid,) for revid in self.revision_ids])
282
282
 
283
283
    def do_write(self):
284
284
        """Write all data to the bundle"""
 
285
        trace.note('Bundling %d revision(s).', len(self.revision_ids))
285
286
        self.repository.lock_read()
286
287
        try:
287
288
            self.bundle.begin()
454
455
 
455
456
    def install(self):
456
457
        """Perform the installation.
457
 
        
 
458
 
458
459
        Must be called with the Repository locked.
459
460
        """
460
461
        self._repository.start_write_group()