コード例 #1
0
ファイル: knitrepo.py プロジェクト: GymWenFLL/tpp_libs
    @needs_read_lock
    def search_missing_revision_ids(self, find_ghosts=True, revision_ids=None, if_present_ids=None, limit=None):
        """See InterRepository.search_missing_revision_ids()."""
        source_ids_set = self._present_source_revisions_for(revision_ids, if_present_ids)
        # source_ids is the worst possible case we may need to pull.
        # now we want to filter source_ids against what we actually
        # have in target, but don't try to check for existence where we know
        # we do not have a revision as that would be pointless.
        target_ids = set(self.target.all_revision_ids())
        possibly_present_revisions = target_ids.intersection(source_ids_set)
        actually_present_revisions = set(self.target._eliminate_revisions_not_present(possibly_present_revisions))
        required_revisions = source_ids_set.difference(actually_present_revisions)
        if revision_ids is not None:
            # we used get_ancestry to determine source_ids then we are assured all
            # revisions referenced are present as they are installed in topological order.
            # and the tip revision was validated by get_ancestry.
            result_set = required_revisions
        else:
            # if we just grabbed the possibly available ids, then
            # we only have an estimate of whats available and need to validate
            # that against the revision records.
            result_set = set(self.source._eliminate_revisions_not_present(required_revisions))
        if limit is not None:
            topo_ordered = self.source.get_graph().iter_topo_order(result_set)
            result_set = set(itertools.islice(topo_ordered, limit))
        return self.source.revision_ids_to_search_result(result_set)


InterRepository.register_optimiser(InterKnitRepo)
コード例 #2
0
ファイル: knitrepo.py プロジェクト: pombreda/dist-packages
        """See InterRepository.search_missing_revision_ids()."""
        source_ids_set = self._present_source_revisions_for(
            revision_ids, if_present_ids)
        # source_ids is the worst possible case we may need to pull.
        # now we want to filter source_ids against what we actually
        # have in target, but don't try to check for existence where we know
        # we do not have a revision as that would be pointless.
        target_ids = set(self.target.all_revision_ids())
        possibly_present_revisions = target_ids.intersection(source_ids_set)
        actually_present_revisions = set(
            self.target._eliminate_revisions_not_present(possibly_present_revisions))
        required_revisions = source_ids_set.difference(actually_present_revisions)
        if revision_ids is not None:
            # we used get_ancestry to determine source_ids then we are assured all
            # revisions referenced are present as they are installed in topological order.
            # and the tip revision was validated by get_ancestry.
            result_set = required_revisions
        else:
            # if we just grabbed the possibly available ids, then
            # we only have an estimate of whats available and need to validate
            # that against the revision records.
            result_set = set(
                self.source._eliminate_revisions_not_present(required_revisions))
        if limit is not None:
            topo_ordered = self.source.get_graph().iter_topo_order(result_set)
            result_set = set(itertools.islice(topo_ordered, limit))
        return self.source.revision_ids_to_search_result(result_set)


InterRepository.register_optimiser(InterKnitRepo)
コード例 #3
0
        # we do not have a revision as that would be pointless.
        target_ids = set(self.target._all_possible_ids())
        possibly_present_revisions = target_ids.intersection(source_ids_set)
        actually_present_revisions = set(
            self.target._eliminate_revisions_not_present(possibly_present_revisions))
        required_revisions = source_ids_set.difference(actually_present_revisions)
        if revision_ids is not None:
            # we used get_ancestry to determine source_ids then we are assured all
            # revisions referenced are present as they are installed in topological order.
            # and the tip revision was validated by get_ancestry.
            result_set = required_revisions
        else:
            # if we just grabbed the possibly available ids, then
            # we only have an estimate of whats available and need to validate
            # that against the revision records.
            result_set = set(
                self.source._eliminate_revisions_not_present(required_revisions))
        if limit is not None:
            topo_ordered = self.get_graph().iter_topo_order(result_set)
            result_set = set(itertools.islice(topo_ordered, limit))
        return self.source.revision_ids_to_search_result(result_set)


InterRepository.register_optimiser(InterWeaveRepo)


def get_extra_interrepo_test_combinations():
    from bzrlib.repofmt import knitrepo
    return [(InterRepository, RepositoryFormat5(),
        knitrepo.RepositoryFormatKnit3())]
コード例 #4
0
ファイル: repository.py プロジェクト: pombreda/dist-packages
        actually_present_revisions = set(
            self.target._eliminate_revisions_not_present(
                possibly_present_revisions))
        required_revisions = source_ids_set.difference(
            actually_present_revisions)
        if revision_ids is not None:
            # we used get_ancestry to determine source_ids then we are assured all
            # revisions referenced are present as they are installed in topological order.
            # and the tip revision was validated by get_ancestry.
            result_set = required_revisions
        else:
            # if we just grabbed the possibly available ids, then
            # we only have an estimate of whats available and need to validate
            # that against the revision records.
            result_set = set(
                self.source._eliminate_revisions_not_present(
                    required_revisions))
        if limit is not None:
            topo_ordered = self.get_graph().iter_topo_order(result_set)
            result_set = set(itertools.islice(topo_ordered, limit))
        return self.source.revision_ids_to_search_result(result_set)


InterRepository.register_optimiser(InterWeaveRepo)


def get_extra_interrepo_test_combinations():
    from bzrlib.repofmt import knitrepo
    return [(InterRepository, RepositoryFormat5(),
             knitrepo.RepositoryFormatKnit3())]