593
593
iterator = self.other_tree.iter_changes(self.base_tree,
594
include_unchanged=True, specific_files=self.interesting_files,
594
include_unchanged=False, specific_files=self.interesting_files,
595
595
extra_trees=[self.this_tree])
596
596
for (file_id, paths, changed, versioned, parents, names, kind,
597
597
executable) in iterator:
1442
1442
elif len(next_lcas) == 1:
1443
1443
parent_map[next_lcas.pop()] = ()
1446
# More than 2 lca's, fall back to grabbing all nodes between
1447
# this and the unique lca.
1448
mutter('More than 2 LCAs, falling back to all nodes for: %s',
1450
cur_lcas = next_lcas
1451
while len(cur_lcas) > 1:
1452
cur_lcas = self.graph.find_lca(*cur_lcas)
1453
if len(cur_lcas) == 0:
1454
# No common base to find, use the full ancestry
1457
unique_lca = cur_lcas.pop()
1458
parent_map.update(self._find_unique_parents(next_lcas,
1445
1461
cur_ancestors = next_lcas
1446
1462
return parent_map
1464
def _find_unique_parents(self, tip_keys, base_key):
1465
"""Find ancestors of tip that aren't ancestors of base.
1467
:param tip_keys: Nodes that are interesting
1468
:param base_key: Cull all ancestors of this node
1469
:return: The parent map for all revisions between tip_keys and
1470
base_key. base_key will be included. References to nodes outside of
1471
the ancestor set will also be removed.
1473
# TODO: (performance) We could also "collapse" the graph at this point,
1474
# to remove uninteresting linear chains of revisions.
1475
# TODO: this would be simpler if find_unique_ancestors took a list
1476
# instead of a single tip, internally it supports it, but it
1477
# isn't a "backwards compatible" api change.
1478
if base_key is None:
1479
parent_map = dict(self.graph.iter_ancestry(tip_keys))
1482
for tip in tip_keys:
1484
self.graph.find_unique_ancestors(tip, [base_key]))
1485
parent_map = self.graph.get_parent_map(interesting)
1486
parent_map[base_key] = ()
1487
culled_parent_map = {}
1488
for key, parent_keys in parent_map.iteritems():
1489
culled_parent_keys = tuple([p for p in parent_keys
1490
if p in parent_map])
1491
culled_parent_map[key] = culled_parent_keys
1492
return culled_parent_map
1448
1494
def _get_interesting_texts(self, parent_map):
1449
1495
"""Return a dict of texts we are interested in.