Skip to content
Snippets Groups Projects
Commit 86c6c7951f74 authored by Sushil khanchi's avatar Sushil khanchi
Browse files

evolve: fix content-div resolution when in parent-child form

case:
"two divergent csets where one is the parent of other"

  cset_b (content-divergent)
  |
  cset_a (content-divergent)
  |
  ~

Before this patch, we were not correctly handling the case when both the
divergent cset are in parent-child form. And its resolution was going
through the logic which solves other variants of content-divergence.

Resolution (after this patch):
merge is performed between the two and parent (or parent's successor,
if apply) of lower one is treated as resolution parent.
parent b8bcf7562ea1
No related branches found
No related tags found
No related merge requests found
......@@ -390,6 +390,9 @@
if otherp1 == divp1:
# both are on the same parents
pass
elif divergent == other.p1():
# both are in parent-child relation
pass
elif succsotherp1 in gca and succsdivp1 in gca:
# both are not on the same parent but have same parents's succs.
if otheronly and divonly:
......@@ -532,10 +535,6 @@
evolvestate[b'temprevs'].append(divergent.node())
evolvestate[b'divergent'] = divergent.node()
# Sometimes we already have the other cset where we want it
if relocatereq and other == divergent.p1():
relocatereq = False
# relocate the other divergent if required
if relocatereq:
# relocating will help us understand during the time of conflicts that
......
......@@ -86,6 +86,6 @@
x cc71ffbc7c00 (1) add foo.txt
$ hg evolve --content-divergent
merge:[6] add foo.txt
with: [4] add foo.txt
merge:[4] add foo.txt
with: [6] add foo.txt
base: [1] add foo.txt
......@@ -91,6 +91,5 @@
base: [1] add foo.txt
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1 new orphan changesets
working directory is now at 5899f25049de
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
working directory is now at 17e66b2fbf1b
$ hg log -G
......@@ -95,4 +94,4 @@
$ hg log -G
@ changeset: 7:5899f25049de
@ changeset: 7:17e66b2fbf1b
| tag: tip
......@@ -98,4 +97,4 @@
| tag: tip
| parent: 4:c17bf400a278
| parent: 0:a24ed8ad918c
| user: test
| date: Wed Dec 31 23:59:58 1969 -0000
......@@ -100,13 +99,5 @@
| user: test
| date: Wed Dec 31 23:59:58 1969 -0000
| instability: orphan
| summary: add foo.txt
|
x changeset: 4:c17bf400a278
| parent: 0:a24ed8ad918c
| user: test
| date: Wed Dec 31 23:59:59 1969 -0000
| obsolete: rewritten using evolve as 7:5899f25049de
| summary: add foo.txt
|
o changeset: 0:a24ed8ad918c
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment