2552
2554
@needs_read_lock
2553
2555
def search_missing_revision_ids(self,
2554
2556
revision_id=symbol_versioning.DEPRECATED_PARAMETER,
2555
find_ghosts=True, revision_ids=None, if_present_ids=None):
2557
find_ghosts=True, revision_ids=None, if_present_ids=None,
2556
2559
"""Return the revision ids that source has that target does not.
2558
2561
:param revision_id: only return revision ids included by this
2582
2585
# stop searching at found target revisions.
2583
2586
if not find_ghosts and (revision_ids is not None or if_present_ids is
2585
return self._walk_to_common_revisions(revision_ids,
2588
result = self._walk_to_common_revisions(revision_ids,
2586
2589
if_present_ids=if_present_ids)
2587
# generic, possibly worst case, slow code path.
2588
target_ids = set(self.target.all_revision_ids())
2589
source_ids = self._present_source_revisions_for(
2590
revision_ids, if_present_ids)
2591
result_set = set(source_ids).difference(target_ids)
2592
result_set = result.get_keys()
2594
# generic, possibly worst case, slow code path.
2595
target_ids = set(self.target.all_revision_ids())
2596
source_ids = self._present_source_revisions_for(
2597
revision_ids, if_present_ids)
2598
result_set = set(source_ids).difference(target_ids)
2599
if limit is not None:
2600
topo_ordered = self.source.get_graph().iter_topo_order(result_set)
2601
result_set = set(itertools.islice(topo_ordered, limit))
2592
2602
return self.source.revision_ids_to_search_result(result_set)
2594
2604
def _present_source_revisions_for(self, revision_ids, if_present_ids=None):