# HG changeset patch # User Pierre-Yves David # Date 1611499142 -19800 # Node ID 32c0b2899fc4104f1328a2f77ebc34d7507ff270 # Parent c0122b98356c385d90e59dac950538d245586a5b divergence-resolution: [patch 2] fix a messed up test case Because of logic change in divergence resolution which causes the order change in picking the resolution parent this test case was messed up. It was supposed to test that that it hits conflict while relocating the divergent cset but because of some change in previous patches, relocation went successful and it hits conflict while merging the two divergent csets. This patch, by making some changes in files content make sure that we get conflict during relocation. diff -r c0122b98356c -r 32c0b2899fc4 tests/test-evolve-content-divergent-interrupted.t --- a/tests/test-evolve-content-divergent-interrupted.t Sun Jan 24 19:47:17 2021 +0530 +++ b/tests/test-evolve-content-divergent-interrupted.t Sun Jan 24 20:09:02 2021 +0530 @@ -259,12 +259,10 @@ $ echo ".*\.orig" > .hgignore $ hg add .hgignore $ hg ci -m "added hgignore" - $ for ch in a b c d; do echo foo > $ch; hg add $ch; hg ci -qm "added "$ch; done; + $ for ch in a b c; do echo foo > $ch; hg add $ch; hg ci -qm "added "$ch; done; $ hg glog - @ 4:c41c793e0ef1 added d - | () draft - o 3:ca1b80f7960a added c + @ 3:ca1b80f7960a added c | () draft o 2:b1661037fa25 added b | () draft @@ -273,28 +271,36 @@ o 0:8fa14d15e168 added hgignore () draft +changes to get merge conflict during relocation + $ echo "some_changes" >> a + $ hg amend + $ echo foo > d + $ hg add d + $ hg ci -m "added d" + $ hg rebase -r . -d .^^^ --config extensions.rebase= - rebasing 4:c41c793e0ef1 tip "added d" + rebasing 5:f8b09dd867e5 tip "added d" $ echo bar > c $ hg add c $ hg amend $ hg up --hidden 'min(desc("added d"))' - 2 files updated, 0 files merged, 0 files removed, 0 files unresolved - updated to hidden changeset c41c793e0ef1 - (hidden revision 'c41c793e0ef1' was rewritten as: 69bdd23a9b0d) - working directory parent is obsolete! (c41c793e0ef1) - (use 'hg evolve' to update to its successor: 69bdd23a9b0d) + 3 files updated, 0 files merged, 0 files removed, 0 files unresolved + updated to hidden changeset f8b09dd867e5 + (hidden revision 'f8b09dd867e5' was rewritten as: 6f7eaf1944c0) + working directory parent is obsolete! (f8b09dd867e5) + (use 'hg evolve' to update to its successor: 6f7eaf1944c0) $ echo bar > d + $ echo "latest_changes" >> a $ hg amend 2 new content-divergent changesets $ hg glog - @ 7:e49523854bc8 added d + @ 8:a8673909e314 added d | () draft - | * 6:69bdd23a9b0d added d + | * 7:6f7eaf1944c0 added d | | () draft - o | 3:ca1b80f7960a added c + o | 4:33c16a2e0eb8 added c | | () draft o | 2:b1661037fa25 added b |/ () draft @@ -304,28 +310,26 @@ () draft $ hg evolve --content-divergent - merge:[6] added d - with: [7] added d - base: [4] added d - rebasing "other" content-divergent changeset e49523854bc8 on c7586e2a9264 - file 'c' was deleted in other but was modified in local. - You can use (c)hanged version, (d)elete, or leave (u)nresolved. - What do you want to do? u - 1 files updated, 0 files merged, 0 files removed, 1 files unresolved + merge:[7] added d + with: [8] added d + base: [5] added d + rebasing "other" content-divergent changeset a8673909e314 on c7586e2a9264 + merging a + warning: conflicts while merging a! (edit, then use 'hg resolve --mark') unresolved merge conflicts (see 'hg help evolve.interrupted') [240] $ hg evolve --abort evolve aborted - working directory is now at e49523854bc8 + working directory is now at a8673909e314 $ hg glog - @ 7:e49523854bc8 added d + @ 8:a8673909e314 added d | () draft - | * 6:69bdd23a9b0d added d + | * 7:6f7eaf1944c0 added d | | () draft - o | 3:ca1b80f7960a added c + o | 4:33c16a2e0eb8 added c | | () draft o | 2:b1661037fa25 added b |/ () draft @@ -339,17 +343,17 @@ --------------------------------------------------------------------------------- $ hg up 'min(desc("added d"))' - 2 files updated, 0 files merged, 1 files removed, 0 files unresolved + 3 files updated, 0 files merged, 1 files removed, 0 files unresolved $ hg rm c $ echo wat > d $ hg amend $ hg glog - @ 8:33e4442acf98 added d + @ 9:b6a3f3ee0c44 added d | () draft - | * 7:e49523854bc8 added d + | * 8:a8673909e314 added d | | () draft - | o 3:ca1b80f7960a added c + | o 4:33c16a2e0eb8 added c | | () draft | o 2:b1661037fa25 added b |/ () draft @@ -359,27 +363,26 @@ () draft $ hg evolve --content-divergent - merge:[7] added d - with: [8] added d - base: [4] added d - rebasing "divergent" content-divergent changeset e49523854bc8 on c7586e2a9264 - merging d - warning: conflicts while merging d! (edit, then use 'hg resolve --mark') - 0 files updated, 0 files merged, 0 files removed, 1 files unresolved + merge:[8] added d + with: [9] added d + base: [5] added d + rebasing "divergent" content-divergent changeset a8673909e314 on c7586e2a9264 + merging a + warning: conflicts while merging a! (edit, then use 'hg resolve --mark') unresolved merge conflicts (see 'hg help evolve.interrupted') [240] $ hg evolve --abort evolve aborted - working directory is now at 33e4442acf98 + working directory is now at b6a3f3ee0c44 $ hg glog - @ 8:33e4442acf98 added d + @ 9:b6a3f3ee0c44 added d | () draft - | * 7:e49523854bc8 added d + | * 8:a8673909e314 added d | | () draft - | o 3:ca1b80f7960a added c + | o 4:33c16a2e0eb8 added c | | () draft | o 2:b1661037fa25 added b |/ () draft