279
279
def get_revision_graph(self, revision_id):
280
# we could probe incrementally until the pending
281
# ghosts list stop growing, but its cheaper for now
282
# to just ask for the complete graph for each repository.
284
for source in self._revision_sources:
285
ghost_graph = source.get_revision_graph_with_ghosts()
286
graphs.append(ghost_graph)
289
if not revision_id in graph.get_ancestors():
291
if absent == len(graphs):
292
raise errors.NoSuchRevision(self._revision_sources[0], revision_id)
281
for source in self._revision_sources:
296
pending = set([revision_id])
297
def find_parents(node_id):
298
"""find the parents for node_id."""
300
ancestors = graph.get_ancestors()
302
return ancestors[node_id]
305
raise errors.NoSuchRevision(self._revision_sources[0], node_id)
307
# all the graphs should have identical parent lists
308
node_id = pending.pop()
283
result.update(source.get_revision_graph(revision_id))
284
except (errors.WeaveRevisionNotPresent, errors.NoSuchRevision), e:
310
result[node_id] = find_parents(node_id)
311
for parent_node in result[node_id]:
312
if not parent_node in result:
313
pending.add(parent_node)
314
except errors.NoSuchRevision:
290
319
def lock_read(self):
291
320
for source in self._revision_sources: