diff --git a/git_upstream/tests/base.py b/git_upstream/tests/base.py index 377fde1..ba07704 100644 --- a/git_upstream/tests/base.py +++ b/git_upstream/tests/base.py @@ -70,6 +70,8 @@ def reverse_toposort(data): yield (node, data[node]) visited[node] = _FINISHED continue + elif visited.get(node) is _FINISHED: + continue visited[node] = _VISITED nodes_to_visit.append(node) @@ -205,7 +207,7 @@ class BuildTree(object): def _commit(self, node): p_node = _get_node_to_pick(node) if p_node: - self.git.cherry_pick(self.graph[p_node]) + self.git.cherry_pick(self.graph[p_node], x=True) else: # standard commit self.gitrepo.add_commits(1, ref="HEAD", diff --git a/git_upstream/tests/searchers/scenarios/changes_merge_result_identical_on_both_sides.yaml b/git_upstream/tests/searchers/scenarios/changes_merge_result_identical_on_both_sides.yaml index 59a917d..3c4cb1d 100644 --- a/git_upstream/tests/searchers/scenarios/changes_merge_result_identical_on_both_sides.yaml +++ b/git_upstream/tests/searchers/scenarios/changes_merge_result_identical_on_both_sides.yaml @@ -24,34 +24,30 @@ Repository layout being tested - B---C---D---G---H---I---J master - / / - / G1 import/next + B---C---D---G---H---I---J master / / - / B1--C1--D1 + / D1--G1--- / / - A---E---F---K---L upstream/master + A--B1--C1---K---L upstream/master tree: - [A, []] - [B, [A]] - [C, [B]] - [D, [C]] - - [E, [A]] - - [F, [E]] - - [G, [D]] - - [B1, [F]] + - [B1, [A]] - [C1, [B1]] + - [G, [D]] - [D1, [C1]] - [G1, [D1]] - - [H, [=G, G1]] + - [H, [G, =G1]] - [I, [H]] - [J, [I]] - - [K, [F]] + - [K, [C1]] - [L, [K]] branches: head: [master, J] upstream: [upstream/master, L] - expected-changes: [B1, C1, D1, G1, H, I, J] + expected-changes: [D1, G1, H, I, J]