1082
1082
search = graph._make_breadth_first_searcher(['head'])
1083
1083
self.assertSeenAndResult(expected, search, search.next_with_ghosts)
1085
def test_breadth_first_stop_searching_late(self):
1086
# A client should be able to say 'stop node X' and have it excluded
1087
# from the result even if X was seen in an older iteration of the
1089
graph = self.make_graph({
1092
'child':[NULL_REVISION],
1095
search = graph._make_breadth_first_searcher(['head'])
1097
(set(['head']), (set(['head']), set(['middle']), 1),
1098
['head'], None, None),
1099
(set(['head', 'middle']), (set(['head']), set(['child']), 2),
1100
['head', 'middle'], None, None),
1101
# 'middle' came from the previous iteration, but we don't stop
1102
# searching it until *after* advancing the searcher.
1103
(set(['head', 'middle', 'child']),
1104
(set(['head']), set(['middle', 'child']), 1),
1105
['head'], None, ['middle', 'child']),
1107
self.assertSeenAndResult(expected, search, search.next)
1108
# using next_with_ghosts:
1109
search = graph._make_breadth_first_searcher(['head'])
1110
self.assertSeenAndResult(expected, search, search.next_with_ghosts)
1085
1112
def test_breadth_first_get_result_ghosts_are_excluded(self):
1086
1113
graph = self.make_graph({
1087
1114
'head':['child', 'ghost'],