--- a/tests/test-evolve-phase-divergence.t Fri Mar 23 15:27:26 2018 +0530
+++ b/tests/test-evolve-phase-divergence.t Fri Mar 23 17:20:20 2018 +0530
@@ -4,6 +4,8 @@
$ cat >> $HGRCPATH <<EOF
> [alias]
> glog = log -GT "{rev}:{node|short} {desc}\n ({bookmarks}) {phase}"
+ > [extensions]
+ > rebase =
> EOF
Setting up a public repo
@@ -496,3 +498,167 @@
| () public
o 0:d3873e73d99e init
() public
+
+Syncing all the repositories
+----------------------------
+
+ $ hg push ../private
+ pushing to ../private
+ searching for changes
+ adding changesets
+ adding manifests
+ adding file changes
+ added 1 changesets with 1 changes to 1 files
+ 2 new obsolescence markers
+ $ hg push ../public
+ pushing to ../public
+ searching for changes
+ adding changesets
+ adding manifests
+ adding file changes
+ added 1 changesets with 1 changes to 1 files
+ 2 new obsolescence markers
+
+Creating phase-divergence with divergent changeset and precursor having
+different parents
+-----------------------------------------------------------------------
+
+Alice creates a changeset and pushes to private repo
+
+ $ echo x > x
+ $ hg ci -Am "added x to x"
+ adding x
+
+ $ hg push ../private
+ pushing to ../private
+ searching for changes
+ adding changesets
+ adding manifests
+ adding file changes
+ added 1 changesets with 1 changes to 1 files
+
+Bob does what he always does, pull from private and push to public, he is acting
+as a CI service
+
+ $ cd ../bob
+ $ hg pull ../private
+ pulling from ../private
+ searching for changes
+ adding changesets
+ adding manifests
+ adding file changes
+ added 2 changesets with 2 changes to 2 files
+ 2 new obsolescence markers
+ new changesets 502e73736632:2352021b3785
+ (run 'hg update' to get a working copy)
+ $ hg push ../public
+ pushing to ../public
+ searching for changes
+ adding changesets
+ adding manifests
+ adding file changes
+ added 1 changesets with 1 changes to 1 files
+
+Alice like always dont care about Bob existence and rebases her changeset and
+then pull from public repo creating phase divergence
+
+ $ cd ../alice
+ $ hg rebase -r . -d .^^^
+ rebasing 9:2352021b3785 "added x to x" (bm tip)
+
+ $ hg pull ../public
+ pulling from ../public
+ searching for changes
+ no changes found
+ 1 new phase-divergent changesets
+
+ $ hg obslog -r .
+ @ 334e300d6db5 (10) added x to x
+ |
+ o 2352021b3785 (9) added x to x
+ rewritten(parent) as 334e300d6db5 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
+
+ $ hg glog -r .^::
+ @ 10:334e300d6db5 added x to x
+ | (bm) draft
+ | o 9:2352021b3785 added x to x
+ | | () public
+ | o 8:502e73736632 phase-divergent update to b756eb10ea73:
+ | |
+ | | foo to bar
+ | | () public
+ | o 6:b756eb10ea73 added bar to bar
+ |/ () public
+ o 5:3d62500c673d phase-divergent update to aa071e5554e3:
+ |
+ ~ added bar to foo
+ () public
+
+Using `hg evolve` to resolve phase-divergence
+---------------------------------------------
+
+ $ hg evolve --phase-divergent
+ recreate:[10] added x to x
+ atop:[9] added x to x
+ rebasing to destination parent: 502e73736632
+ (leaving bookmark bm)
+ computing new diff
+ committed as 5388376cb2f0
+ working directory is now at 5388376cb2f0
+
+XXX: we should not have created a new commit here
+ $ hg glog
+ @ 12:5388376cb2f0 phase-divergent update to 2352021b3785:
+ |
+ | added x to x
+ | () draft
+ | x 11:b1a0e143e32b added x to x
+ | | (bm) draft
+ o | 9:2352021b3785 added x to x
+ |/ () public
+ o 8:502e73736632 phase-divergent update to b756eb10ea73:
+ |
+ | foo to bar
+ | () public
+ o 6:b756eb10ea73 added bar to bar
+ | () public
+ o 5:3d62500c673d phase-divergent update to aa071e5554e3:
+ |
+ | added bar to foo
+ | () public
+ o 3:aa071e5554e3 added foo to foo
+ | () public
+ o 1:4d1169d82e47 modify a
+ | () public
+ o 0:d3873e73d99e init
+ () public
+
+ $ hg obslog -r .
+ @ 5388376cb2f0 (12) phase-divergent update to 2352021b3785:
+ |
+ x b1a0e143e32b (11) added x to x
+ | rewritten(description, parent, content) as 5388376cb2f0 using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+ |
+ x 334e300d6db5 (10) added x to x
+ | rewritten(parent) as b1a0e143e32b using evolve by test (Thu Jan 01 00:00:00 1970 +0000)
+ |
+ o 2352021b3785 (9) added x to x
+ rewritten(parent) as 334e300d6db5 using rebase by test (Thu Jan 01 00:00:00 1970 +0000)
+
+XXX: The existence of this changeset is wrong, moreover its diff is wrong
+ $ hg exp
+ # HG changeset patch
+ # User test
+ # Date 0 0
+ # Thu Jan 01 00:00:00 1970 +0000
+ # Node ID 5388376cb2f0f9bc4842361fb16fe66ce5cc2f6d
+ # Parent 2352021b37851be226ebed109b0eb6eada918566
+ phase-divergent update to 2352021b3785:
+
+ added x to x
+
+ diff -r 2352021b3785 -r 5388376cb2f0 bar
+ --- a/bar Thu Jan 01 00:00:00 1970 +0000
+ +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+ @@ -1,1 +0,0 @@
+ -foo