diff tests/test-evolve-content-divergent-interrupted.t @ 5830:67fc03f42d92 mercurial-5.0

test-compat: merge mercurial-5.1 into mercurial-5.0 # no-check-commit
author Anton Shestakov <av6@dwimlabs.net>
date Thu, 11 Mar 2021 14:22:45 +0800
parents c2c85576ddfb fd039a7f0c3c
children be8f7eb3f3a0 e82ad19eb3cc
line wrap: on
line diff
--- a/tests/test-evolve-content-divergent-interrupted.t	Sun Jan 31 15:39:25 2021 +0800
+++ b/tests/test-evolve-content-divergent-interrupted.t	Thu Mar 11 14:22:45 2021 +0800
@@ -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 "added d" (tip)
+  rebasing 5:f8b09dd867e5 "added d" (tip)
   $ 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.
-  What do you want to do?
-  use (c)hanged version, (d)elete, or leave (u)nresolved? 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')
   [1]
 
   $ 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,44 @@
       () 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
+  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')
+  [1]
+
+this test case is mainly to test that we hit merge conlict while merging the
+two divergent csets, so resolving this one which happened during relocation
+  $ echo a > a
+  $ hg res -m
+  (no more unresolved files)
+  continue: hg evolve --continue
+
+  $ hg evolve -c
+  evolving 8:a8673909e314 "added d"
+  merging a
   merging d
+  warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
   warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
-  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 2 files unresolved
   unresolved merge conflicts
   (see 'hg help evolve.interrupted')
   [1]
 
   $ 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
@@ -517,12 +538,12 @@
 
   $ hg evolve --stop
   stopped the interrupted evolve
-  working directory is now at e49523854bc8
+  working directory is now at 517d4375cb72
 
   $ hg glog
-  *  7:517d4375cb72 added d
+  @  7:517d4375cb72 added d
   |   () draft
-  | @  5:e49523854bc8 added d
+  | *  5:e49523854bc8 added d
   | |   () draft
   | o  3:ca1b80f7960a added c
   | |   () draft
@@ -537,17 +558,25 @@
 relocation
 ---------------------------------------------------------------------------
 
-  $ echo babar > c
-  $ hg add c
-  c already tracked!
+Making changes to make sure that it hits conflict while relocating
+  $ hg up -r 3
+  2 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  $ echo "some_changes" >> a
+  $ hg amend
+  1 new orphan changesets
+  $ hg next
+  move:[5] added d
+  atop:[8] added c
+  working directory is now at dc9ba677cba1
+  $ echo "latest_changes" >> a
   $ hg amend
   $ hg glog
-  @  8:2d664a4ab749 added d
+  @  10:0892835a581f added d
+  |   () draft
+  o  8:33c16a2e0eb8 added c
   |   () draft
   | *  7:517d4375cb72 added d
   | |   () draft
-  o |  3:ca1b80f7960a added c
-  | |   () draft
   o |  2:b1661037fa25 added b
   |/    () draft
   o  1:c7586e2a9264 added a
@@ -557,47 +586,43 @@
 
   $ hg evolve --content-divergent
   merge:[7] added d
-  with: [8] added d
+  with: [10] added d
   base: [4] added d
-  rebasing "other" content-divergent changeset 2d664a4ab749 on c7586e2a9264
-  file 'c' was deleted in local but was modified in other.
-  What do you want to do?
-  use (c)hanged version, leave (d)eleted, or leave (u)nresolved? u
-  merging d
-  warning: conflicts while merging d! (edit, then use 'hg resolve --mark')
-  0 files updated, 0 files merged, 0 files removed, 2 files unresolved
+  rebasing "other" content-divergent changeset 0892835a581f on c7586e2a9264
+  merging a
+  warning: conflicts while merging a! (edit, then use 'hg resolve --mark')
   unresolved merge conflicts
   (see 'hg help evolve.interrupted')
   [1]
 
   $ hg diff
-  diff -r 517d4375cb72 c
+  diff -r c7586e2a9264 a
+  --- a/a	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/a	Thu Jan 01 00:00:00 1970 +0000
+  @@ -1,1 +1,6 @@
+   foo
+  +<<<<<<< destination: c7586e2a9264 - test: added a
+  +=======
+  +some_changes
+  +latest_changes
+  +>>>>>>> evolving:    0892835a581f - test: added d
+  diff -r c7586e2a9264 d
   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
-  +++ b/c	Thu Jan 01 00:00:00 1970 +0000
+  +++ b/d	Thu Jan 01 00:00:00 1970 +0000
   @@ -0,0 +1,1 @@
-  +babar
-  diff -r 517d4375cb72 d
-  --- a/d	Thu Jan 01 00:00:00 1970 +0000
-  +++ b/d	Thu Jan 01 00:00:00 1970 +0000
-  @@ -1,1 +1,5 @@
-  +<<<<<<< local: 517d4375cb72 - test: added d
-   foobar
-  +=======
   +bar
-  +>>>>>>> other: e315463d94bd - test: added d
 
   $ hg evolve --stop
   stopped the interrupted evolve
-  working directory is now at 2d664a4ab749
+  working directory is now at 0892835a581f
 
-XXX: we should have preserved the wdir to be at rev 8
   $ hg glog
-  @  8:2d664a4ab749 added d
+  @  10:0892835a581f added d
+  |   () draft
+  o  8:33c16a2e0eb8 added c
   |   () draft
   | *  7:517d4375cb72 added d
   | |   () draft
-  o |  3:ca1b80f7960a added c
-  | |   () draft
   o |  2:b1661037fa25 added b
   |/    () draft
   o  1:c7586e2a9264 added a