279
280
return root, ancestors, descendants, common
282
def common_ancestor(revision_a, revision_b, revision_source):
283
def common_ancestor(revision_a, revision_b, revision_source,
284
root, ancestors, descendants, common = \
285
combined_graph(revision_a, revision_b, revision_source)
286
except bzrlib.errors.NoCommonRoot:
287
raise bzrlib.errors.NoCommonAncestor(revision_a, revision_b)
289
distances = node_distances (descendants, ancestors, root)
290
farthest = select_farthest(distances, common)
291
if farthest is None or farthest == NULL_REVISION:
292
raise bzrlib.errors.NoCommonAncestor(revision_a, revision_b)
287
pb.update('Picking ancestor', 1, 3)
288
root, ancestors, descendants, common = \
289
combined_graph(revision_a, revision_b, revision_source)
290
except bzrlib.errors.NoCommonRoot:
291
raise bzrlib.errors.NoCommonAncestor(revision_a, revision_b)
293
pb.update('Picking ancestor', 2, 3)
294
distances = node_distances (descendants, ancestors, root)
295
pb.update('Picking ancestor', 3, 2)
296
farthest = select_farthest(distances, common)
297
if farthest is None or farthest == NULL_REVISION:
298
raise bzrlib.errors.NoCommonAncestor(revision_a, revision_b)