|
@@ -219,35 +219,6 @@ def _all_same(seq, key):
|
|
|
return _all_eq(seq[1:], key, key(seq[0]))
|
|
|
|
|
|
|
|
|
-def _matches_any_parent(store, parent_tree_ids, changes):
|
|
|
- have = [c for c in changes if c is not None]
|
|
|
- assert have
|
|
|
- new = have[0].new
|
|
|
-
|
|
|
-
|
|
|
- for change in have:
|
|
|
- if new.sha == change.old.sha:
|
|
|
- return True
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- missing = [p for p, c in zip(parent_tree_ids, changes) if c is None]
|
|
|
- get = store.__getitem__
|
|
|
- for parent_tree_id in missing:
|
|
|
- tree = get(parent_tree_id)
|
|
|
- try:
|
|
|
- _, old_sha = tree.lookup_path(get, new.path)
|
|
|
- except KeyError:
|
|
|
- continue
|
|
|
- if new.sha == old_sha:
|
|
|
- return True
|
|
|
- return False
|
|
|
-
|
|
|
-
|
|
|
def tree_changes_for_merge(store, parent_tree_ids, tree_id,
|
|
|
rename_detector=None):
|
|
|
"""Get the tree changes for a merge tree relative to all its parents.
|
|
@@ -294,7 +265,9 @@ def tree_changes_for_merge(store, parent_tree_ids, tree_id,
|
|
|
yield changes
|
|
|
elif not _all_same(have, change_type):
|
|
|
yield changes
|
|
|
- elif not _matches_any_parent(store, parent_tree_ids, changes):
|
|
|
+ elif None not in changes:
|
|
|
+
|
|
|
+
|
|
|
yield changes
|
|
|
|
|
|
|