evolve: test to show that --stop is not working when "divergent" relocated
authorSushil khanchi <sushilkhanchi97@gmail.com>
Thu, 28 Nov 2019 17:58:45 +0530
changeset 5028 109889c7d02d
parent 5027 08be8a4d5196
child 5029 421b295e32b4
evolve: test to show that --stop is not working when "divergent" relocated Right now, --stop leave the intermediate changeset (relocating the divergent changeset to its new location behind). This this is an incomplete step it should be removed by `hg --stop`.
tests/test-evolve-content-divergent-stack.t
--- a/tests/test-evolve-content-divergent-stack.t	Wed Nov 27 22:52:08 2019 +0530
+++ b/tests/test-evolve-content-divergent-stack.t	Thu Nov 28 17:58:45 2019 +0530
@@ -487,7 +487,9 @@
   (see 'hg help evolve.interrupted')
   [1]
 
-(make sure that --abort works fine when relocation of "divergent" also included)
+As now we have interrupted evolution of stack of content-divergent cset (when
+relocation of "divergent" also included) let's test --abort and --stop 
+test --abort:
   $ hg evolve --abort
   2 new content-divergent changesets
   evolve aborted
@@ -502,8 +504,71 @@
   instability: content-divergent
   summary:     added d
   
-
-Again, let's evolve the stack
+test --stop:
+  $ hg log -G
+  *  changeset:   19:c351be27f199
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  instability: content-divergent
+  |  summary:     added d
+  |
+  *  changeset:   18:eaf34afe4df3
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  instability: content-divergent
+  |  summary:     added c
+  |
+  @  changeset:   17:509103439e5e
+  |  parent:      5:8e222f257bbf
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  instability: content-divergent
+  |  summary:     added b
+  |
+  | *  changeset:   16:91c8ccb9c241
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | |  instability: content-divergent
+  | |  summary:     added d
+  | |
+  | *  changeset:   15:48b0f803817a
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | |  instability: content-divergent
+  | |  summary:     added c
+  | |
+  | *  changeset:   14:2a955e808c53
+  | |  parent:      10:c04ff147ef79
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | |  instability: content-divergent
+  | |  summary:     added b
+  | |
+  | *  changeset:   10:c04ff147ef79
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | |  instability: content-divergent
+  | |  summary:     added a
+  | |
+  | o  changeset:   9:2228e3b74514
+  | |  parent:      0:8fa14d15e168
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | |  summary:     add newfile
+  | |
+  * |  changeset:   5:8e222f257bbf
+  |/   parent:      0:8fa14d15e168
+  |    user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    instability: content-divergent
+  |    summary:     watbar to a
+  |
+  o  changeset:   0:8fa14d15e168
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     added hgignore
+  
   $ hg evolve --content-divergent
   merge:[10] added a
   with: [5] watbar to a
@@ -523,26 +588,174 @@
   (see 'hg help evolve.interrupted')
   [1]
 
+  $ hg evolve --stop
+  1 new orphan changesets
+  stopped the interrupted evolve
+  working directory is now at 509103439e5e
+  $ hg log -G
+  *  changeset:   22:a93be2347074
+  |  tag:         tip
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  instability: content-divergent
+  |  summary:     added b
+  |
+  o  changeset:   21:74fbf3e6a0b6
+  |  parent:      9:2228e3b74514
+  |  user:        test
+  |  date:        Thu Jan 01 00:00:00 1970 +0000
+  |  summary:     watbar to a
+  |
+  | *  changeset:   19:c351be27f199
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | |  instability: orphan, content-divergent
+  | |  summary:     added d
+  | |
+  | *  changeset:   18:eaf34afe4df3
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | |  instability: orphan, content-divergent
+  | |  summary:     added c
+  | |
+  | @  changeset:   17:509103439e5e
+  | |  parent:      5:8e222f257bbf
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | |  instability: orphan, content-divergent
+  | |  summary:     added b
+  | |
+  | | *  changeset:   16:91c8ccb9c241
+  | | |  user:        test
+  | | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | | |  instability: orphan, content-divergent
+  | | |  summary:     added d
+  | | |
+  | | *  changeset:   15:48b0f803817a
+  | | |  user:        test
+  | | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | | |  instability: orphan, content-divergent
+  | | |  summary:     added c
+  | | |
+  | | x  changeset:   14:2a955e808c53
+  | | |  parent:      10:c04ff147ef79
+  | | |  user:        test
+  | | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | | |  obsolete:    rebased using evolve as 22:a93be2347074
+  | | |  summary:     added b
+  | | |
+  +---x  changeset:   10:c04ff147ef79
+  | |    user:        test
+  | |    date:        Thu Jan 01 00:00:00 1970 +0000
+  | |    obsolete:    rewritten using evolve as 21:74fbf3e6a0b6
+  | |    summary:     added a
+  | |
+  o |  changeset:   9:2228e3b74514
+  | |  parent:      0:8fa14d15e168
+  | |  user:        test
+  | |  date:        Thu Jan 01 00:00:00 1970 +0000
+  | |  summary:     add newfile
+  | |
+  | x  changeset:   5:8e222f257bbf
+  |/   parent:      0:8fa14d15e168
+  |    user:        test
+  |    date:        Thu Jan 01 00:00:00 1970 +0000
+  |    obsolete:    rebased using evolve as 21:74fbf3e6a0b6
+  |    summary:     watbar to a
+  |
+  o  changeset:   0:8fa14d15e168
+     user:        test
+     date:        Thu Jan 01 00:00:00 1970 +0000
+     summary:     added hgignore
+  
+  $ hg obslog -r 'desc("watbar to a")' --all
+  o    74fbf3e6a0b6 (21) watbar to a
+  |\
+  x |  186bdc2cdfa2 (20) watbar to a
+  | |    rewritten as 74fbf3e6a0b6 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  c04ff147ef79 (10) added a
+  | |    rewritten(description, content) as 74fbf3e6a0b6 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  x |  8e222f257bbf (5) watbar to a
+  |/     rewritten(parent) as 186bdc2cdfa2 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+  x  c7586e2a9264 (1) added a
+       rewritten(description, content) as 8e222f257bbf using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+       rewritten(parent) as c04ff147ef79 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
+  
+  $ hg obslog -r 'desc("added b")' --all
+  @  509103439e5e (17) added b
+  |
+  | *  a93be2347074 (22) added b
+  | |
+  | x  2a955e808c53 (14) added b
+  | |    rewritten(parent) as a93be2347074 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  x |  d5f148423c16 (6) added b
+  | |    rewritten(content) as 509103439e5e using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  6eb54b5af3fb (11) added b
+  |/     rewritten(content) as 2a955e808c53 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+  x  b1661037fa25 (2) added b
+       rewritten(parent) as 6eb54b5af3fb using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
+       rewritten(parent) as d5f148423c16 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  
+
+Again, let's evolve the stack
+  $ hg evolve --content-divergent
+  skipping 48b0f803817a: have a different parent than eaf34afe4df3 (not handled yet)
+  | 48b0f803817a, eaf34afe4df3 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(48b0f803817a)' -r eaf34afe4df3
+  | - or:     hg rebase --dest 'p1(eaf34afe4df3)' -r 48b0f803817a
+  merge:[22] added b
+  with: [17] added b
+  base: [2] added b
+  rebasing "other" content-divergent changeset 509103439e5e on 74fbf3e6a0b6
+  merging b
+  warning: conflicts while merging b! (edit, then use 'hg resolve --mark')
+  0 files updated, 0 files merged, 0 files removed, 1 files unresolved
+  unresolved merge conflicts
+  (see 'hg help evolve.interrupted')
+  [1]
+
   $ echo foo > b
   $ hg res -m
   (no more unresolved files)
   continue: hg evolve --continue
   $ hg evolve --continue
-  merge:[15] added c
-  with: [18] added c
-  base: [3] added c
-  rebasing "divergent" content-divergent changeset 48b0f803817a on 4e29776e83a5
-  rebasing "other" content-divergent changeset eaf34afe4df3 on 4e29776e83a5
-  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  merge:[16] added d
-  with: [19] added d
-  base: [4] added d
-  rebasing "divergent" content-divergent changeset 91c8ccb9c241 on 77126af93a25
-  rebasing "other" content-divergent changeset c351be27f199 on 77126af93a25
-  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  skipping 91c8ccb9c241: have a different parent than c351be27f199 (not handled yet)
+  | 91c8ccb9c241, c351be27f199 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(91c8ccb9c241)' -r c351be27f199
+  | - or:     hg rebase --dest 'p1(c351be27f199)' -r 91c8ccb9c241
   working directory is now at 4e29776e83a5
 
   $ hg evolve -l
+  48b0f803817a: added c
+    orphan: 2a955e808c53 (obsolete parent)
+    content-divergent: eaf34afe4df3 (draft) (precursor ca1b80f7960a)
+  
+  91c8ccb9c241: added d
+    orphan: 48b0f803817a (orphan parent)
+    content-divergent: c351be27f199 (draft) (precursor c41c793e0ef1)
+  
+  eaf34afe4df3: added c
+    orphan: 509103439e5e (obsolete parent)
+    content-divergent: 48b0f803817a (draft) (precursor ca1b80f7960a)
+  
+  c351be27f199: added d
+    orphan: eaf34afe4df3 (orphan parent)
+    content-divergent: 91c8ccb9c241 (draft) (precursor c41c793e0ef1)
+  
 
   $ cd ..