changeset 4993:e0b5ce458af5 stable

evolve: add tests for the case when resolution parent is ambiguous
author Sushil khanchi <sushilkhanchi97@gmail.com>
date Sat, 07 Dec 2019 03:27:50 +0530
parents 1eab41625dee
children 8b6e2565aaf3
files tests/test-evolve-content-divergent-stack.t
diffstat 1 files changed, 121 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-evolve-content-divergent-stack.t	Fri Dec 06 23:43:00 2019 +0530
+++ b/tests/test-evolve-content-divergent-stack.t	Sat Dec 07 03:27:50 2019 +0530
@@ -503,3 +503,124 @@
      +b without typo
   
   $ cd ..
+
+Testing case when resolution parent is ambiguous (MultipleSuccessorsError)
+--------------------------------------------------------------------------
+
+  $ hg init multiplesuccs1
+  $ cd multiplesuccs1
+  $ echo base > base
+  $ hg ci -Aqm "added base"
+  $ echo foo > foo
+  $ hg ci -Aqm "added foo"
+  $ echo bar > bar; echo car > car
+  $ hg ci -Aqm "added bar and car"
+  $ echo dar > dar
+  $ hg ci -Aqm "added dar"
+
+  $ cd ..
+  $ hg clone multiplesuccs1 multiplesuccs2
+  updating to branch default
+  5 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ cd multiplesuccs2
+  $ hg up -r "desc('added foo')"
+  0 files updated, 0 files merged, 3 files removed, 0 files unresolved
+  $ echo newfoo > foo
+  $ hg amend
+  2 new orphan changesets
+  $ hg evolve
+  move:[2] added bar and car
+  atop:[4] added foo
+  move:[3] added dar
+
+  $ cd ../multiplesuccs1
+  $ hg up -r "desc('added base')"
+  0 files updated, 0 files merged, 4 files removed, 0 files unresolved
+  $ echo tuna > tuna
+  $ hg ci -Aqm "added tuna"
+  $ hg rebase -s "desc('added foo')" -d .
+  rebasing 1:8da7bbaea4f7 "added foo"
+  rebasing 2:7f4b97b13607 "added bar and car"
+  rebasing 3:9f12b2fcb3de "added dar"
+
+  $ cd ../multiplesuccs2
+  $ hg pull
+  pulling from $TESTTMP/multiplesuccs1
+  searching for changes
+  adding changesets
+  adding manifests
+  adding file changes
+  added 4 changesets with 1 changes to 5 files (+1 heads)
+  3 new obsolescence markers
+  6 new content-divergent changesets
+  new changesets 9703820a7d5b:9a1f460df8b5 (4 drafts)
+  (run 'hg heads' to see heads, 'hg merge' to merge)
+  $ hg glog
+  *  10:9a1f460df8b5 added dar
+  |   () [default] draft
+  *  9:7dd5b9d42ef3 added bar and car
+  |   () [default] draft
+  *  8:afd8b2ea1b77 added foo
+  |   () [default] draft
+  o  7:9703820a7d5b added tuna
+  |   () [default] draft
+  | *  6:57a3f8edf065 added dar
+  | |   () [default] draft
+  | *  5:f4ed107810a7 added bar and car
+  | |   () [default] draft
+  | @  4:8a2d93492f59 added foo
+  |/    () [default] draft
+  o  0:bde1d2b6b5e5 added base
+      () [default] draft
+
+  $ hg evolve -r 4+5 --content-divergent
+  merge:[8] added foo
+  with: [4] added foo
+  base: [1] added foo
+  rebasing "other" content-divergent changeset 8a2d93492f59 on 9703820a7d5b
+  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  merge:[9] added bar and car
+  with: [5] added bar and car
+  base: [2] added bar and car
+  rebasing "divergent" content-divergent changeset 7dd5b9d42ef3 on 8ef6ad88580d
+  rebasing "other" content-divergent changeset f4ed107810a7 on 8ef6ad88580d
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  2 new orphan changesets
+  working directory is now at 8ef6ad88580d
+
+  $ hg glog
+  o  15:09ba686a465e added bar and car
+  |   () [default] draft
+  @  12:8ef6ad88580d added foo
+  |   () [default] draft
+  | *  10:9a1f460df8b5 added dar
+  | |   () [default] draft
+  | x  9:7dd5b9d42ef3 added bar and car
+  | |   () [default] draft
+  | x  8:afd8b2ea1b77 added foo
+  |/    () [default] draft
+  o  7:9703820a7d5b added tuna
+  |   () [default] draft
+  | *  6:57a3f8edf065 added dar
+  | |   () [default] draft
+  | x  5:f4ed107810a7 added bar and car
+  | |   () [default] draft
+  | x  4:8a2d93492f59 added foo
+  |/    () [default] draft
+  o  0:bde1d2b6b5e5 added base
+      () [default] draft
+
+  $ echo bar > bar; hg ci -Aqm "added bar"
+  $ echo car > car; hg ci -Aqm "added car"
+  $ hg prune --split -s 16+17 -r 15
+  1 changesets pruned
+
+  $ hg evolve --content-divergent
+  skipping 57a3f8edf065: have a different parent than 9a1f460df8b5 (not handled yet)
+  | 57a3f8edf065, 9a1f460df8b5 are not based on the same changeset.
+  | With the current state of its implementation, 
+  | evolve does not work in that case.
+  | rebase one of them next to the other and run 
+  | this command again.
+  | - either: hg rebase --dest 'p1(57a3f8edf065)' -r 9a1f460df8b5
+  | - or:     hg rebase --dest 'p1(9a1f460df8b5)' -r 57a3f8edf065