~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repository.py

  • Committer: Robert Collins
  • Date: 2008-04-14 22:39:51 UTC
  • mto: This revision was merged to the branch mainline in revision 3367.
  • Revision ID: robertc@robertcollins.net-20080414223951-6cnknexu9wfniwno
 * Severe performance degradation in fetching from knit repositories to
   packs due to parsing the entire revisions.kndx on every graph walk
   iteration fixed by using the Repository.get_graph API. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2385
2385
        :return: A set of revision ids.
2386
2386
        """
2387
2387
        graph = self.source.get_graph()
 
2388
        target_graph = self.target.get_graph()
2388
2389
        missing_revs = set()
2389
2390
        # ensure we don't pay silly lookup costs.
2390
2391
        revision_ids = frozenset(revision_ids)
2399
2400
                absent_ids = set(revision_ids.intersection(ghosts))
2400
2401
                # If all absent_ids are present in target, no error is needed.
2401
2402
                absent_ids.difference_update(
2402
 
                    self.target.has_revisions(absent_ids))
 
2403
                    set(target_graph.get_parent_map(absent_ids)))
2403
2404
                if absent_ids:
2404
2405
                    raise errors.NoSuchRevision(self.source, absent_ids.pop())
2405
2406
            # we don't care about other ghosts as we can't fetch them and
2406
2407
            # haven't been asked to.
2407
2408
            next_revs = set(next_revs)
2408
2409
            # we always have NULL_REVISION present.
2409
 
            have_revs = self.target.has_revisions(next_revs).union(null_set)
 
2410
            have_revs = set(target_graph.get_parent_map(next_revs)).union(null_set)
2410
2411
            missing_revs.update(next_revs - have_revs)
2411
2412
            searcher.stop_searching_any(have_revs)
2412
2413
        return searcher.get_result()