tests/test-evolve-content-divergent-relocation.t
branchmercurial-4.7
changeset 5367 cb5983c0287f
parent 5349 e8660b28bfee
child 5368 844b1ad5b34b
--- a/tests/test-evolve-content-divergent-relocation.t	Wed Apr 08 01:16:59 2020 +0800
+++ b/tests/test-evolve-content-divergent-relocation.t	Fri May 08 22:18:15 2020 +0800
@@ -70,10 +70,10 @@
   base: [2] added b
   rebasing "other" content-divergent changeset da4b96f4a8d6 on c7586e2a9264
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  working directory is now at 171614c9a791
+  working directory is now at e7fdc662d630
 
   $ hg glog
-  @  8:171614c9a791 added b
+  @  8:e7fdc662d630 added b
   |   () [default] draft
   | *  4:c41c793e0ef1 added d
   | |   () [default] draft
@@ -91,16 +91,39 @@
   # User test
   # Date 0 0
   #      Thu Jan 01 00:00:00 1970 +0000
-  # Node ID 171614c9a7914c53f531373b95632323fdbbac8d
+  # Node ID e7fdc662d6305fee2908c3f1630e0b20d6f4689a
   # Parent  c7586e2a92645e473645847a7b69a6dc52be4276
   added b
   
-  diff -r c7586e2a9264 -r 171614c9a791 b
+  diff -r c7586e2a9264 -r e7fdc662d630 b
   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   +++ b/b	Thu Jan 01 00:00:00 1970 +0000
   @@ -0,0 +1,1 @@
   +bar
 
+  $ hg debugobsolete
+  b1661037fa25511d0b7ccddf405e336f9d7d3424 7ed0642d644bb9ad93d252dd9ffe7b4729febe48 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  b1661037fa25511d0b7ccddf405e336f9d7d3424 da4b96f4a8d610a85b225583138f681d67e275dd 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  da4b96f4a8d610a85b225583138f681d67e275dd 11f849d7159fa30a63dbbc1a6d251a8d996baeb5 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  7ed0642d644bb9ad93d252dd9ffe7b4729febe48 e7fdc662d6305fee2908c3f1630e0b20d6f4689a 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
+  11f849d7159fa30a63dbbc1a6d251a8d996baeb5 e7fdc662d6305fee2908c3f1630e0b20d6f4689a 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'evolve', 'user': 'test'}
+  $ hg obslog --all
+  @    e7fdc662d630 (8) added b
+  |\     amended(content) from 11f849d7159f using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    rewritten from 7ed0642d644b using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  x |  11f849d7159f (7) added b
+  | |    rebased(parent) from da4b96f4a8d6 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  7ed0642d644b (5) added b
+  | |    amended(content) from b1661037fa25 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  x |  da4b96f4a8d6 (6) added b
+  |/     rebased(parent) from b1661037fa25 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+  x  b1661037fa25 (2) added b
+  
+
 Resolving orphans to get back to a normal graph
 
   $ hg evolve --all
@@ -108,11 +131,11 @@
   atop:[8] added b
   move:[4] added d
   $ hg glog
-  o  10:4ae4427ee9f8 added d
+  o  10:be5a8b9faa8a added d
   |   () [default] draft
-  o  9:917281f93fcb added c
+  o  9:e2ce33033e42 added c
   |   () [default] draft
-  @  8:171614c9a791 added b
+  @  8:e7fdc662d630 added b
   |   () [default] draft
   o  1:c7586e2a9264 added a
   |   () [default] draft
@@ -124,7 +147,7 @@
   $ echo x > x
   $ hg ci -Aqm "added x"
   $ hg glog -r .
-  @  11:71a392c714b5 added x
+  @  11:801b5920c7ea added x
   |   () [default] draft
   ~
 
@@ -134,26 +157,26 @@
   (branches are permanent and global, did you want a bookmark?)
   $ hg amend -m "added foo to x"
 
-  $ hg up 71a392c714b5 --hidden
+  $ hg up 'predecessors(.)' --hidden
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  updated to hidden changeset 71a392c714b5
-  (hidden revision '71a392c714b5' was rewritten as: 1e1a50385a7d)
-  working directory parent is obsolete! (71a392c714b5)
-  (use 'hg evolve' to update to its successor: 1e1a50385a7d)
-  $ hg rebase -r . -d 4ae4427ee9f8 --config experimental.evolution.allowdivergence=True
-  rebasing 11:71a392c714b5 "added x"
+  updated to hidden changeset 801b5920c7ea
+  (hidden revision '801b5920c7ea' was rewritten as: 5cf74a13db18)
+  working directory parent is obsolete! (801b5920c7ea)
+  (use 'hg evolve' to update to its successor: 5cf74a13db18)
+  $ hg rebase -r . -d 'desc("added d")' --config experimental.evolution.allowdivergence=True
+  rebasing 11:801b5920c7ea "added x"
   2 new content-divergent changesets
 
   $ hg glog
-  @  13:1e4f6b3bb39b added x
+  @  13:45e15d6e88f5 added x
   |   () [default] draft
-  | *  12:1e1a50385a7d added foo to x
+  | *  12:5cf74a13db18 added foo to x
   | |   () [bar] draft
-  o |  10:4ae4427ee9f8 added d
+  o |  10:be5a8b9faa8a added d
   | |   () [default] draft
-  o |  9:917281f93fcb added c
+  o |  9:e2ce33033e42 added c
   |/    () [default] draft
-  o  8:171614c9a791 added b
+  o  8:e7fdc662d630 added b
   |   () [default] draft
   o  1:c7586e2a9264 added a
   |   () [default] draft
@@ -164,9 +187,9 @@
   merge:[13] added x
   with: [12] added foo to x
   base: [11] added x
-  rebasing "other" content-divergent changeset 1e1a50385a7d on 4ae4427ee9f8
+  rebasing "other" content-divergent changeset 5cf74a13db18 on be5a8b9faa8a
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  working directory is now at b006cf317e0e
+  working directory is now at 4e844ab5e814
 
   $ hg exp
   # HG changeset patch
@@ -174,11 +197,11 @@
   # Date 0 0
   #      Thu Jan 01 00:00:00 1970 +0000
   # Branch bar
-  # Node ID b006cf317e0ed16dbe786c439577475580f645f1
-  # Parent  4ae4427ee9f8f0935211fd66360948b77ab5aee9
+  # Node ID 4e844ab5e8142d26fb1f0990486379f2410b0358
+  # Parent  be5a8b9faa8af54f115aa168a2c8564acb40c37d
   added foo to x
   
-  diff -r 4ae4427ee9f8 -r b006cf317e0e x
+  diff -r be5a8b9faa8a -r 4e844ab5e814 x
   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   +++ b/x	Thu Jan 01 00:00:00 1970 +0000
   @@ -0,0 +1,1 @@
@@ -187,19 +210,49 @@
 The above `hg exp` and the following log call demonstrates that message, content
 and branch change is preserved in case of relocation
   $ hg glog
-  @  15:b006cf317e0e added foo to x
+  @  15:4e844ab5e814 added foo to x
   |   () [bar] draft
-  o  10:4ae4427ee9f8 added d
+  o  10:be5a8b9faa8a added d
   |   () [default] draft
-  o  9:917281f93fcb added c
+  o  9:e2ce33033e42 added c
   |   () [default] draft
-  o  8:171614c9a791 added b
+  o  8:e7fdc662d630 added b
   |   () [default] draft
   o  1:c7586e2a9264 added a
   |   () [default] draft
   o  0:8fa14d15e168 added hgignore
       () [default] draft
 
+  $ hg debugobsolete
+  b1661037fa25511d0b7ccddf405e336f9d7d3424 7ed0642d644bb9ad93d252dd9ffe7b4729febe48 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  b1661037fa25511d0b7ccddf405e336f9d7d3424 da4b96f4a8d610a85b225583138f681d67e275dd 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  da4b96f4a8d610a85b225583138f681d67e275dd 11f849d7159fa30a63dbbc1a6d251a8d996baeb5 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  7ed0642d644bb9ad93d252dd9ffe7b4729febe48 e7fdc662d6305fee2908c3f1630e0b20d6f4689a 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
+  11f849d7159fa30a63dbbc1a6d251a8d996baeb5 e7fdc662d6305fee2908c3f1630e0b20d6f4689a 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'evolve', 'user': 'test'}
+  ca1b80f7960aae2306287bab52b4090c59af8c29 e2ce33033e42db2e61a5f71c6dfb52a33efeaf6a 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  c41c793e0ef1ddb463e85ea9491e377d01127ba2 be5a8b9faa8af54f115aa168a2c8564acb40c37d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  801b5920c7ea8d4ebdbc9cfc1e79e665dea2f211 5cf74a13db180e33dc2df8cd2aa70b21252a2a64 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '73', 'operation': 'amend', 'user': 'test'}
+  801b5920c7ea8d4ebdbc9cfc1e79e665dea2f211 45e15d6e88f5bd23ba360dff0c7591eca2d99f43 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  5cf74a13db180e33dc2df8cd2aa70b21252a2a64 911c21adca136894a2b35f0a58fae7ee94fa5e61 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  45e15d6e88f5bd23ba360dff0c7591eca2d99f43 4e844ab5e8142d26fb1f0990486379f2410b0358 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '73', 'operation': 'evolve', 'user': 'test'}
+  911c21adca136894a2b35f0a58fae7ee94fa5e61 4e844ab5e8142d26fb1f0990486379f2410b0358 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
+  $ hg obslog --all
+  @    4e844ab5e814 (15) added foo to x
+  |\     rewritten(description, branch, content) from 45e15d6e88f5 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    rewritten from 911c21adca13 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  x |  45e15d6e88f5 (13) added x
+  | |    rebased(parent) from 801b5920c7ea using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  911c21adca13 (14) added foo to x
+  | |    rebased(parent) from 5cf74a13db18 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  5cf74a13db18 (12) added foo to x
+  |/     rewritten(description, branch, content) from 801b5920c7ea using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+  x  801b5920c7ea (11) added x
+  
+
 Testing when both the content-divergence are on different parents and resolution
 will lead to conflicts
 ---------------------------------------------------------------------------------
@@ -210,37 +263,37 @@
   $ echo y > y
   $ hg ci -Aqm "added y"
   $ hg glog -r .
-  @  16:fc6ad2bac162 added y
+  @  16:ecf1d3992eb4 added y
   |   () [default] draft
   ~
 
   $ echo bar > y
   $ hg amend
 
-  $ hg up fc6ad2bac162 --hidden
+  $ hg up 'predecessors(.)' --hidden
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
-  updated to hidden changeset fc6ad2bac162
-  (hidden revision 'fc6ad2bac162' was rewritten as: 2a9f6ccbdeba)
-  working directory parent is obsolete! (fc6ad2bac162)
-  (use 'hg evolve' to update to its successor: 2a9f6ccbdeba)
-  $ hg rebase -r . -d b006cf317e0e --config experimental.evolution.allowdivergence=True
-  rebasing 16:fc6ad2bac162 "added y"
+  updated to hidden changeset ecf1d3992eb4
+  (hidden revision 'ecf1d3992eb4' was rewritten as: 9c32d35206fb)
+  working directory parent is obsolete! (ecf1d3992eb4)
+  (use 'hg evolve' to update to its successor: 9c32d35206fb)
+  $ hg rebase -r . -d 'desc("added foo to x")' --config experimental.evolution.allowdivergence=True
+  rebasing 16:ecf1d3992eb4 "added y"
   2 new content-divergent changesets
   $ echo wat > y
   $ hg amend
 
   $ hg glog
-  @  19:b4575ed6fcfc added y
+  @  19:0faa43228ee7 added y
   |   () [bar] draft
-  | *  17:2a9f6ccbdeba added y
+  | *  17:9c32d35206fb added y
   | |   () [default] draft
-  o |  15:b006cf317e0e added foo to x
+  o |  15:4e844ab5e814 added foo to x
   | |   () [bar] draft
-  o |  10:4ae4427ee9f8 added d
+  o |  10:be5a8b9faa8a added d
   | |   () [default] draft
-  o |  9:917281f93fcb added c
+  o |  9:e2ce33033e42 added c
   |/    () [default] draft
-  o  8:171614c9a791 added b
+  o  8:e7fdc662d630 added b
   |   () [default] draft
   o  1:c7586e2a9264 added a
   |   () [default] draft
@@ -251,7 +304,7 @@
   merge:[19] added y
   with: [17] added y
   base: [16] added y
-  rebasing "other" content-divergent changeset 2a9f6ccbdeba on b006cf317e0e
+  rebasing "other" content-divergent changeset 9c32d35206fb on 4e844ab5e814
   merging y
   warning: conflicts while merging y! (edit, then use 'hg resolve --mark')
   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
@@ -264,55 +317,74 @@
   (no more unresolved files)
   continue: hg evolve --continue
   $ hg evolve --continue
-  working directory is now at 7bbcf24ddecf
+  working directory is now at ba11a9f47a2e
 
   $ hg glog
-  @  21:7bbcf24ddecf added y
+  @  21:ba11a9f47a2e added y
   |   () [bar] draft
-  o  15:b006cf317e0e added foo to x
+  o  15:4e844ab5e814 added foo to x
   |   () [bar] draft
-  o  10:4ae4427ee9f8 added d
+  o  10:be5a8b9faa8a added d
   |   () [default] draft
-  o  9:917281f93fcb added c
+  o  9:e2ce33033e42 added c
   |   () [default] draft
-  o  8:171614c9a791 added b
+  o  8:e7fdc662d630 added b
   |   () [default] draft
   o  1:c7586e2a9264 added a
   |   () [default] draft
   o  0:8fa14d15e168 added hgignore
       () [default] draft
 
+  $ hg debugobsolete
+  b1661037fa25511d0b7ccddf405e336f9d7d3424 7ed0642d644bb9ad93d252dd9ffe7b4729febe48 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  b1661037fa25511d0b7ccddf405e336f9d7d3424 da4b96f4a8d610a85b225583138f681d67e275dd 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  da4b96f4a8d610a85b225583138f681d67e275dd 11f849d7159fa30a63dbbc1a6d251a8d996baeb5 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  7ed0642d644bb9ad93d252dd9ffe7b4729febe48 e7fdc662d6305fee2908c3f1630e0b20d6f4689a 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
+  11f849d7159fa30a63dbbc1a6d251a8d996baeb5 e7fdc662d6305fee2908c3f1630e0b20d6f4689a 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'evolve', 'user': 'test'}
+  ca1b80f7960aae2306287bab52b4090c59af8c29 e2ce33033e42db2e61a5f71c6dfb52a33efeaf6a 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  c41c793e0ef1ddb463e85ea9491e377d01127ba2 be5a8b9faa8af54f115aa168a2c8564acb40c37d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  801b5920c7ea8d4ebdbc9cfc1e79e665dea2f211 5cf74a13db180e33dc2df8cd2aa70b21252a2a64 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '73', 'operation': 'amend', 'user': 'test'}
+  801b5920c7ea8d4ebdbc9cfc1e79e665dea2f211 45e15d6e88f5bd23ba360dff0c7591eca2d99f43 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  5cf74a13db180e33dc2df8cd2aa70b21252a2a64 911c21adca136894a2b35f0a58fae7ee94fa5e61 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  45e15d6e88f5bd23ba360dff0c7591eca2d99f43 4e844ab5e8142d26fb1f0990486379f2410b0358 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '73', 'operation': 'evolve', 'user': 'test'}
+  911c21adca136894a2b35f0a58fae7ee94fa5e61 4e844ab5e8142d26fb1f0990486379f2410b0358 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
+  ecf1d3992eb4d9700d441013fc4e89014692b461 9c32d35206fb5c3bf0ac814d410914d54a959a87 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  ecf1d3992eb4d9700d441013fc4e89014692b461 1bb9315961377c18863281be7634ec8ff9b73ea9 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '68', 'operation': 'rebase', 'user': 'test'}
+  1bb9315961377c18863281be7634ec8ff9b73ea9 0faa43228ee7fb9c993f076cef7e2ac14c85954b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  9c32d35206fb5c3bf0ac814d410914d54a959a87 0fc12918c8daa12ca83ce1e2a38e252b063b6276 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  0faa43228ee7fb9c993f076cef7e2ac14c85954b ba11a9f47a2e4a3380c4d5f80f64de41645a6681 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'evolve', 'user': 'test'}
+  0fc12918c8daa12ca83ce1e2a38e252b063b6276 ba11a9f47a2e4a3380c4d5f80f64de41645a6681 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '72', 'operation': 'evolve', 'user': 'test'}
   $ hg obslog -r . --all
-  @    7bbcf24ddecf (21) added y
-  |\
-  x |  48f745db3f53 (20) added y
-  | |    rewritten(branch, content) as 7bbcf24ddecf using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
-  | |
-  | x  b4575ed6fcfc (19) added y
-  | |    amended(content) as 7bbcf24ddecf using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  @    ba11a9f47a2e (21) added y
+  |\     amended(content) from 0faa43228ee7 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    rewritten(branch, content) from 0fc12918c8da using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
   | |
-  x |  2a9f6ccbdeba (17) added y
-  | |    rebased(parent) as 48f745db3f53 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  x |  0faa43228ee7 (19) added y
+  | |    amended(content) from 1bb931596137 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  0fc12918c8da (20) added y
+  | |    rebased(parent) from 9c32d35206fb using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
   | |
-  | x  96b677f01b81 (18) added y
-  |/     amended(content) as b4575ed6fcfc using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  x |  1bb931596137 (18) added y
+  | |    rewritten(branch, parent) from ecf1d3992eb4 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  9c32d35206fb (17) added y
+  |/     amended(content) from ecf1d3992eb4 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
   |
-  x  fc6ad2bac162 (16) added y
-       amended(content) as 2a9f6ccbdeba using amend by test (Thu Jan 01 00:00:00 1970 +0000)
-       rewritten(branch, parent) as 96b677f01b81 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
+  x  ecf1d3992eb4 (16) added y
   
 
 checking that relocated commit is there
-  $ hg exp 48f745db3f53 --hidden
+  $ hg exp 20 --hidden
   # HG changeset patch
   # User test
   # Date 0 0
   #      Thu Jan 01 00:00:00 1970 +0000
-  # Node ID 48f745db3f5300363ca248b9aeab20ff2a55fbb3
-  # Parent  b006cf317e0ed16dbe786c439577475580f645f1
+  # Node ID 0fc12918c8daa12ca83ce1e2a38e252b063b6276
+  # Parent  4e844ab5e8142d26fb1f0990486379f2410b0358
   added y
   
-  diff -r b006cf317e0e -r 48f745db3f53 y
+  diff -r 4e844ab5e814 -r 0fc12918c8da y
   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   +++ b/y	Thu Jan 01 00:00:00 1970 +0000
   @@ -0,0 +1,1 @@
@@ -322,15 +394,15 @@
 ----------------------------------------------------------------------
 
   $ hg glog
-  @  21:7bbcf24ddecf added y
+  @  21:ba11a9f47a2e added y
   |   () [bar] draft
-  o  15:b006cf317e0e added foo to x
+  o  15:4e844ab5e814 added foo to x
   |   () [bar] draft
-  o  10:4ae4427ee9f8 added d
+  o  10:be5a8b9faa8a added d
   |   () [default] draft
-  o  9:917281f93fcb added c
+  o  9:e2ce33033e42 added c
   |   () [default] draft
-  o  8:171614c9a791 added b
+  o  8:e7fdc662d630 added b
   |   () [default] draft
   o  1:c7586e2a9264 added a
   |   () [default] draft
@@ -343,7 +415,7 @@
   $ echo z > z
   $ hg ci -Aqm "added z"
   $ hg glog -r .
-  @  22:daf1de08f3b0 added z
+  @  22:2048a66e8834 added z
   |   () [default] draft
   ~
 
@@ -351,32 +423,32 @@
   $ hg add y
   $ hg amend
 
-  $ hg up daf1de08f3b0 --hidden
+  $ hg up 'predecessors(.)' --hidden
   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
-  updated to hidden changeset daf1de08f3b0
-  (hidden revision 'daf1de08f3b0' was rewritten as: 3f7a1f693080)
-  working directory parent is obsolete! (daf1de08f3b0)
-  (use 'hg evolve' to update to its successor: 3f7a1f693080)
-  $ hg rebase -r . -d 7bbcf24ddecf --config experimental.evolution.allowdivergence=True
-  rebasing 22:daf1de08f3b0 "added z"
+  updated to hidden changeset 2048a66e8834
+  (hidden revision '2048a66e8834' was rewritten as: 9bc2ace42175)
+  working directory parent is obsolete! (2048a66e8834)
+  (use 'hg evolve' to update to its successor: 9bc2ace42175)
+  $ hg rebase -r . -d 'desc("added y")' --config experimental.evolution.allowdivergence=True
+  rebasing 22:2048a66e8834 "added z"
   2 new content-divergent changesets
   $ echo bar > z
   $ hg amend
 
   $ hg glog
-  @  25:53242575ffa9 added z
+  @  25:ad2ec16eca1e added z
   |   () [bar] draft
-  | *  23:3f7a1f693080 added z
+  | *  23:9bc2ace42175 added z
   | |   () [default] draft
-  o |  21:7bbcf24ddecf added y
+  o |  21:ba11a9f47a2e added y
   | |   () [bar] draft
-  o |  15:b006cf317e0e added foo to x
+  o |  15:4e844ab5e814 added foo to x
   | |   () [bar] draft
-  o |  10:4ae4427ee9f8 added d
+  o |  10:be5a8b9faa8a added d
   | |   () [default] draft
-  o |  9:917281f93fcb added c
+  o |  9:e2ce33033e42 added c
   |/    () [default] draft
-  o  8:171614c9a791 added b
+  o  8:e7fdc662d630 added b
   |   () [default] draft
   o  1:c7586e2a9264 added a
   |   () [default] draft
@@ -387,7 +459,7 @@
   merge:[25] added z
   with: [23] added z
   base: [22] added z
-  rebasing "other" content-divergent changeset 3f7a1f693080 on 7bbcf24ddecf
+  rebasing "other" content-divergent changeset 9bc2ace42175 on ba11a9f47a2e
   merging y
   warning: conflicts while merging y! (edit, then use 'hg resolve --mark')
   unresolved merge conflicts
@@ -395,16 +467,16 @@
   [1]
 
   $ hg diff
-  diff -r 7bbcf24ddecf y
+  diff -r ba11a9f47a2e y
   --- a/y	Thu Jan 01 00:00:00 1970 +0000
   +++ b/y	Thu Jan 01 00:00:00 1970 +0000
   @@ -1,1 +1,5 @@
-  +<<<<<<< destination: 7bbcf24ddecf bar - test: added y
+  +<<<<<<< destination: ba11a9f47a2e bar - test: added y
    watbar
   +=======
   +foo
-  +>>>>>>> evolving:    3f7a1f693080 - test: added z
-  diff -r 7bbcf24ddecf z
+  +>>>>>>> evolving:    9bc2ace42175 - test: added z
+  diff -r ba11a9f47a2e z
   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   +++ b/z	Thu Jan 01 00:00:00 1970 +0000
   @@ -0,0 +1,1 @@
@@ -416,7 +488,7 @@
   continue: hg evolve --continue
 
   $ hg evolve --continue
-  evolving 23:3f7a1f693080 "added z"
+  evolving 23:9bc2ace42175 "added z"
   merging y
   warning: conflicts while merging y! (edit, then use 'hg resolve --mark')
   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
@@ -425,35 +497,35 @@
   [1]
 
   $ hg diff
-  diff -r 53242575ffa9 y
+  diff -r ad2ec16eca1e y
   --- a/y	Thu Jan 01 00:00:00 1970 +0000
   +++ b/y	Thu Jan 01 00:00:00 1970 +0000
   @@ -1,1 +1,5 @@
-  +<<<<<<< local: 53242575ffa9 bar - test: added z
+  +<<<<<<< local: ad2ec16eca1e bar - test: added z
    watbar
   +=======
   +foo
-  +>>>>>>> other: cdb0643c69fc - test: added z
+  +>>>>>>> other: a7326a078527 - test: added z
 
   $ echo foo > y
   $ hg resolve -m
   (no more unresolved files)
   continue: hg evolve --continue
   $ hg evolve --continue
-  working directory is now at 6fc7d9682de6
+  working directory is now at 45e55c9ab3d0
 
   $ hg glog
-  @  27:6fc7d9682de6 added z
+  @  27:45e55c9ab3d0 added z
   |   () [bar] draft
-  o  21:7bbcf24ddecf added y
+  o  21:ba11a9f47a2e added y
   |   () [bar] draft
-  o  15:b006cf317e0e added foo to x
+  o  15:4e844ab5e814 added foo to x
   |   () [bar] draft
-  o  10:4ae4427ee9f8 added d
+  o  10:be5a8b9faa8a added d
   |   () [default] draft
-  o  9:917281f93fcb added c
+  o  9:e2ce33033e42 added c
   |   () [default] draft
-  o  8:171614c9a791 added b
+  o  8:e7fdc662d630 added b
   |   () [default] draft
   o  1:c7586e2a9264 added a
   |   () [default] draft
@@ -466,20 +538,172 @@
   # Date 0 0
   #      Thu Jan 01 00:00:00 1970 +0000
   # Branch bar
-  # Node ID 6fc7d9682de6e3bee6c8b1266b756ed7d522b7e4
-  # Parent  7bbcf24ddecfe97d7c2ac6fa8c07c155c8fda47b
+  # Node ID 45e55c9ab3d0b4746161fcbe5b6c062eb4647fdb
+  # Parent  ba11a9f47a2e4a3380c4d5f80f64de41645a6681
   added z
   
-  diff -r 7bbcf24ddecf -r 6fc7d9682de6 y
+  diff -r ba11a9f47a2e -r 45e55c9ab3d0 y
   --- a/y	Thu Jan 01 00:00:00 1970 +0000
   +++ b/y	Thu Jan 01 00:00:00 1970 +0000
   @@ -1,1 +1,1 @@
   -watbar
   +foo
-  diff -r 7bbcf24ddecf -r 6fc7d9682de6 z
+  diff -r ba11a9f47a2e -r 45e55c9ab3d0 z
   --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   +++ b/z	Thu Jan 01 00:00:00 1970 +0000
   @@ -0,0 +1,1 @@
   +bar
 
+  $ hg debugobsolete
+  b1661037fa25511d0b7ccddf405e336f9d7d3424 7ed0642d644bb9ad93d252dd9ffe7b4729febe48 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  b1661037fa25511d0b7ccddf405e336f9d7d3424 da4b96f4a8d610a85b225583138f681d67e275dd 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  da4b96f4a8d610a85b225583138f681d67e275dd 11f849d7159fa30a63dbbc1a6d251a8d996baeb5 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  7ed0642d644bb9ad93d252dd9ffe7b4729febe48 e7fdc662d6305fee2908c3f1630e0b20d6f4689a 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
+  11f849d7159fa30a63dbbc1a6d251a8d996baeb5 e7fdc662d6305fee2908c3f1630e0b20d6f4689a 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'evolve', 'user': 'test'}
+  ca1b80f7960aae2306287bab52b4090c59af8c29 e2ce33033e42db2e61a5f71c6dfb52a33efeaf6a 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  c41c793e0ef1ddb463e85ea9491e377d01127ba2 be5a8b9faa8af54f115aa168a2c8564acb40c37d 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  801b5920c7ea8d4ebdbc9cfc1e79e665dea2f211 5cf74a13db180e33dc2df8cd2aa70b21252a2a64 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '73', 'operation': 'amend', 'user': 'test'}
+  801b5920c7ea8d4ebdbc9cfc1e79e665dea2f211 45e15d6e88f5bd23ba360dff0c7591eca2d99f43 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  5cf74a13db180e33dc2df8cd2aa70b21252a2a64 911c21adca136894a2b35f0a58fae7ee94fa5e61 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  45e15d6e88f5bd23ba360dff0c7591eca2d99f43 4e844ab5e8142d26fb1f0990486379f2410b0358 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '73', 'operation': 'evolve', 'user': 'test'}
+  911c21adca136894a2b35f0a58fae7ee94fa5e61 4e844ab5e8142d26fb1f0990486379f2410b0358 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
+  ecf1d3992eb4d9700d441013fc4e89014692b461 9c32d35206fb5c3bf0ac814d410914d54a959a87 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  ecf1d3992eb4d9700d441013fc4e89014692b461 1bb9315961377c18863281be7634ec8ff9b73ea9 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '68', 'operation': 'rebase', 'user': 'test'}
+  1bb9315961377c18863281be7634ec8ff9b73ea9 0faa43228ee7fb9c993f076cef7e2ac14c85954b 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  9c32d35206fb5c3bf0ac814d410914d54a959a87 0fc12918c8daa12ca83ce1e2a38e252b063b6276 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  0faa43228ee7fb9c993f076cef7e2ac14c85954b ba11a9f47a2e4a3380c4d5f80f64de41645a6681 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'evolve', 'user': 'test'}
+  0fc12918c8daa12ca83ce1e2a38e252b063b6276 ba11a9f47a2e4a3380c4d5f80f64de41645a6681 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '72', 'operation': 'evolve', 'user': 'test'}
+  2048a66e8834bda866dcc8c479f091897816833e 9bc2ace42175da7380251fca97730f62ff5b9185 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  2048a66e8834bda866dcc8c479f091897816833e ee19d6cc67048a1a7469268068a1413611720975 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '68', 'operation': 'rebase', 'user': 'test'}
+  ee19d6cc67048a1a7469268068a1413611720975 ad2ec16eca1eac4cf5045b496efa6205652e9a02 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  9bc2ace42175da7380251fca97730f62ff5b9185 a7326a0785271a7bef2e812a9a742fb4256b4a3c 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '12', 'operation': 'evolve', 'user': 'test'}
+  ad2ec16eca1eac4cf5045b496efa6205652e9a02 45e55c9ab3d0b4746161fcbe5b6c062eb4647fdb 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'evolve', 'user': 'test'}
+  a7326a0785271a7bef2e812a9a742fb4256b4a3c 45e55c9ab3d0b4746161fcbe5b6c062eb4647fdb 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '72', 'operation': 'evolve', 'user': 'test'}
+  $ hg obslog --all
+  @    45e55c9ab3d0 (27) added z
+  |\     rewritten(branch, content) from a7326a078527 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    amended(content) from ad2ec16eca1e using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  x |  a7326a078527 (26) added z
+  | |    rewritten(parent, content) from 9bc2ace42175 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  ad2ec16eca1e (25) added z
+  | |    amended(content) from ee19d6cc6704 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  x |  9bc2ace42175 (23) added z
+  | |    amended(content) from 2048a66e8834 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  ee19d6cc6704 (24) added z
+  |/     rewritten(branch, parent) from 2048a66e8834 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+  x  2048a66e8834 (22) added z
+  
+
   $ cd ..
+
+Testing when relocation results in nothing to commit
+----------------------------------------------------
+
+Set up a repo where relocation results in no changes to commit because the
+changes from the relocated node are already in the destination.
+
+  $ hg init nothing-to-commit
+  $ cd nothing-to-commit
+  $ echo 0 > a
+  $ hg ci -Aqm initial
+  $ echo 1 > a
+  $ hg ci -Aqm upstream
+  $ hg prev -q
+
+Create the source of divergence.
+  $ echo 0 > b
+  $ hg ci -Aqm divergent
+
+The first side of the divergence get rebased on top of upstream.
+  $ hg rebase -r . -d 'desc("upstream")'
+  rebasing 2:898ddd4443b3 "divergent" (tip)
+  $ hg --hidden co 2 -q
+  updated to hidden changeset 898ddd4443b3
+  (hidden revision '898ddd4443b3' was rewritten as: befae6138569)
+  working directory parent is obsolete! (898ddd4443b3)
+
+The other side of the divergence gets amended so it matches upstream.
+Relocation (onto upstream) will therefore result in no changes to commit.
+  $ hg revert -r 'desc("upstream")' --all
+  reverting a
+  removing b
+  $ hg amend --config experimental.evolution.allowdivergence=True
+  2 new content-divergent changesets
+
+Add a commit on top. This one should become an orphan. Evolving it later
+should put it on top of the other divergent side (the one that's on top of
+upstream)
+  $ echo 0 > c
+  $ hg ci -Aqm child
+  $ hg co -q null
+  $ hg glog
+  o  5:88473f9137d1 child
+  |   () [default] draft
+  *  4:4cc21313ecee divergent
+  |   () [default] draft
+  | *  3:befae6138569 divergent
+  | |   () [default] draft
+  | o  1:33c576d20069 upstream
+  |/    () [default] draft
+  o  0:98a3f8f02ba7 initial
+      () [default] draft
+  $ hg evolve --content-divergent
+  merge:[3] divergent
+  with: [4] divergent
+  base: [2] divergent
+  rebasing "other" content-divergent changeset 4cc21313ecee on 33c576d20069
+  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  1 new orphan changesets
+  $ hg glog
+  o  7:cc3d0c6117c7 divergent
+  |   () [default] draft
+  | *  5:88473f9137d1 child
+  | |   () [default] draft
+  | x  4:4cc21313ecee divergent
+  | |   () [default] draft
+  o |  1:33c576d20069 upstream
+  |/    () [default] draft
+  o  0:98a3f8f02ba7 initial
+      () [default] draft
+
+  $ hg evolve --any
+  move:[5] child
+  atop:[7] divergent
+  $ hg glog
+  o  8:916b4ec3b91f child
+  |   () [default] draft
+  o  7:cc3d0c6117c7 divergent
+  |   () [default] draft
+  o  1:33c576d20069 upstream
+  |   () [default] draft
+  o  0:98a3f8f02ba7 initial
+      () [default] draft
+  $ hg debugobsolete
+  898ddd4443b3d5520bf48f22f9411d5a0751cf2e befae61385695f1ae4b78b030ad91075b2b523ef 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'rebase', 'user': 'test'}
+  898ddd4443b3d5520bf48f22f9411d5a0751cf2e 4cc21313ecee97ce33265514a0596a192bfa6b3f 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'amend', 'user': 'test'}
+  4cc21313ecee97ce33265514a0596a192bfa6b3f bf4fe3a3afeb14c338094f41a35863921856592f 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '12', 'operation': 'evolve', 'user': 'test'}
+  befae61385695f1ae4b78b030ad91075b2b523ef cc3d0c6117c7400995107497370fa4c2138399cd 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '8', 'operation': 'evolve', 'user': 'test'}
+  bf4fe3a3afeb14c338094f41a35863921856592f cc3d0c6117c7400995107497370fa4c2138399cd 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '0', 'operation': 'evolve', 'user': 'test'}
+  88473f9137d12e90055d30bbb9b78dd786520870 916b4ec3b91fd03826bd4b179051ae3cee633b56 0 (Thu Jan 01 00:00:00 1970 +0000) {'ef1': '4', 'operation': 'evolve', 'user': 'test'}
+  $ hg obslog -r 'desc("divergent")' --all
+  o    cc3d0c6117c7 (7) divergent
+  |\     amended(content) from befae6138569 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |    rewritten from bf4fe3a3afeb using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  x |  befae6138569 (3) divergent
+  | |    rebased(parent) from 898ddd4443b3 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  bf4fe3a3afeb (6) divergent
+  | |    rewritten(parent, content) from 4cc21313ecee using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+  | |
+  | x  4cc21313ecee (4) divergent
+  |/     amended(content) from 898ddd4443b3 using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  |
+  x  898ddd4443b3 (2) divergent
+  
+  $ cd ..