+ if not isinstance(search, graph.EverythingResult):
^- can we add an attribute, rather than an isinstance check?
if not search.is_everything():
490 + def _present_source_revisions_for(self, revision_ids):
491 + """Returns set of all revisions in ancestry of revision_ids present in
492 + the source repo.
493 +
494 + :param revision_ids: if None, all revisions in source are returned.
495 + """
496 + if revision_ids is not None:
497 + # First, ensure all specified revisions exist. Callers expect
498 + # NoSuchRevision when they pass absent revision_ids here.
499 + revision_ids = set(revision_ids)
500 + graph = self.source.get_graph()
501 + present_revs = set(graph.get_parent_map(revision_ids))
502 + missing = revision_ids.difference(present_revs)
503 + if missing:
504 + raise errors.NoSuchRevision(self.source, missing.pop())
505 + source_ids = [rev_id for (rev_id, parents) in
506 + self.source.get_graph().iter_ancestry(revision_ids)
507 + if rev_id != _mod_revision.NULL_REVISION
508 + and parents is not None]
^- you have "graph = self.source.get_graph()" and then you inline "self.source.get_graph()" into the source_ids list comprehension. Better to re-use the graph object.
Why don't EverythingNotInOther and NotInOtherForRevs implement these functions?
Overall, I think these changes seem good, but I don't really see how this gets us closer to computing a search without having one end doing a step-by-step search. (Certainly you're still using the same 'search_missing_revision_ids', and you don't seem to be serializing anything over the wire...)
+ if not isinstance(search, graph.Everythin gResult) :
^- can we add an attribute, rather than an isinstance check?
if not search. is_everything( ):
490 + def _present_ source_ revisions_ for(self, revision_ids): get_graph( ) get_parent_ map(revision_ ids)) ids.difference( present_ revs) NoSuchRevision( self.source, missing.pop()) get_graph( ).iter_ ancestry( revision_ ids) NULL_REVISION get_graph( )" and then you inline "self.source. get_graph( )" into the source_ids list comprehension. Better to re-use the graph object.
491 + """Returns set of all revisions in ancestry of revision_ids present in
492 + the source repo.
493 +
494 + :param revision_ids: if None, all revisions in source are returned.
495 + """
496 + if revision_ids is not None:
497 + # First, ensure all specified revisions exist. Callers expect
498 + # NoSuchRevision when they pass absent revision_ids here.
499 + revision_ids = set(revision_ids)
500 + graph = self.source.
501 + present_revs = set(graph.
502 + missing = revision_
503 + if missing:
504 + raise errors.
505 + source_ids = [rev_id for (rev_id, parents) in
506 + self.source.
507 + if rev_id != _mod_revision.
508 + and parents is not None]
^- you have "graph = self.source.
145 + def get_recipe(self): rror(self. get_recipe) struct( self):
146 + raise NotImplementedE
147 +
148 + def get_network_
149 + return ('everything',)
Why don't EverythingNotIn Other and NotInOtherForRevs implement these functions?
Overall, I think these changes seem good, but I don't really see how this gets us closer to computing a search without having one end doing a step-by-step search. (Certainly you're still using the same 'search_ missing_ revision_ ids', and you don't seem to be serializing anything over the wire...)