# HG changeset patch # User Sushil khanchi # Date 1598816458 -19800 # Node ID 4c3656aaacc63f5d8c278b36a470fe29ce2bafcd # Parent a8c21707e9c46b0b15d0e042fb4a9407c8ac91ec evolve: make sure we don't miss merging content of divergent changesets It was skipping _mergecontentdivergents() in the continue case of content-divergence when we hit merge conflict in relocation of "divergent" and relocation of "other" is not required. And because of this skip, merging the content of two divergent changesets was not performed correctly. Changes in test file reflect the fixed behavior. diff -r a8c21707e9c4 -r 4c3656aaacc6 hgext3rd/evolve/evolvecmd.py --- a/hgext3rd/evolve/evolvecmd.py Wed Aug 05 00:16:26 2020 +0530 +++ b/hgext3rd/evolve/evolvecmd.py Mon Aug 31 01:10:58 2020 +0530 @@ -2059,12 +2059,11 @@ evolvestate[b'relocated-other'] = other.node() evolvestate[b'temprevs'].append(other.node()) evolvestate[b'other-divergent'] = other.node() - # continue the resolution by merging the content-divergence - _mergecontentdivergents(repo, progresscb, - divergent, - repo[newother], - repo[base], - evolvestate) + # continue the resolution by merging the content-divergence + divergent = evolvestate[b'divergent'] + other = evolvestate[b'other-divergent'] + _mergecontentdivergents(repo, progresscb, repo[divergent], + repo[other], repo[base], evolvestate) if evolvestate[b'relocating-other']: newother = _completerelocation(ui, repo, evolvestate) diff -r a8c21707e9c4 -r 4c3656aaacc6 tests/test-evolve-content-divergent-stack.t --- a/tests/test-evolve-content-divergent-stack.t Wed Aug 05 00:16:26 2020 +0530 +++ b/tests/test-evolve-content-divergent-stack.t Mon Aug 31 01:10:58 2020 +0530 @@ -252,22 +252,27 @@ $ hg evolve --continue evolving 7:3ce4be6d8e5e "added c" - working directory is now at 9cede3ad51fc -# XXX: resultant cset should contain the newfile added on "other" side + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + working directory is now at 3d278b2f60ff $ hg log -p -l1 - changeset: 19:9cede3ad51fc + changeset: 19:3d278b2f60ff tag: tip parent: 16:fb488ec29dfa user: test date: Thu Jan 01 00:00:00 1970 +0000 summary: added c and newfile - diff -r fb488ec29dfa -r 9cede3ad51fc c + diff -r fb488ec29dfa -r 3d278b2f60ff c --- a/c Thu Jan 01 00:00:00 1970 +0000 +++ b/c Thu Jan 01 00:00:00 1970 +0000 @@ -1,1 +1,1 @@ -conflict +c + diff -r fb488ec29dfa -r 3d278b2f60ff newfile + --- /dev/null Thu Jan 01 00:00:00 1970 +0000 + +++ b/newfile Thu Jan 01 00:00:00 1970 +0000 + @@ -0,0 +1,1 @@ + +new_file Resolving content-divergence of a stack with different parents