tests: make test-evolve-phase-divergence more descriptive
authorPulkit Goyal <7895pulkit@gmail.com>
Fri, 30 Mar 2018 19:37:06 +0200
changeset 3617 a0e322641810
parent 3616 f6d629514607
child 3618 2d8e39919742
tests: make test-evolve-phase-divergence more descriptive This patch adds description to what each part is doing in test-evolve-phase-divergence.t and some commands which should be used to analyze the divergence before resolving that.
tests/test-evolve-phase-divergence.t
--- a/tests/test-evolve-phase-divergence.t	Fri Mar 30 20:26:54 2018 +0200
+++ b/tests/test-evolve-phase-divergence.t	Fri Mar 30 19:37:06 2018 +0200
@@ -1,6 +1,14 @@
 ** Test for handling of phase divergent changesets by `hg evolve` **
 ====================================================================
 
+  $ cat >> $HGRCPATH <<EOF
+  > [alias]
+  > glog = log -GT "{rev}:{node|short} {desc}\n ({bookmarks}) {phase}"
+  > EOF
+
+Setting up a public repo
+------------------------
+
   $ hg init public
   $ cd public
   $ echo a > a
@@ -14,6 +22,10 @@
   $ cd ..
 
   $ evolvepath=$(echo $(dirname $TESTDIR))/hgext3rd/evolve/
+
+Setting up a private non-publishing repo
+----------------------------------------
+
   $ hg clone -U public private
   $ cd private
   $ cat >> .hg/hgrc <<EOF
@@ -26,9 +38,17 @@
   > EOF
   $ cd ..
 
+Setting up couple of more instances of private repo
+---------------------------------------------------
+
   $ cp -a private alice
   $ cp -a private bob
 
+Creating a phase-divergence changeset
+-------------------------------------
+
+Alice creating a draft changeset and pushing to main private repo
+
   $ cd alice
   $ hg update
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
@@ -41,8 +61,14 @@
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files
-  $ hg log -r 'draft()'
-  1:4d1169d82e47@default(draft) modify a
+  $ hg glog
+  @  1:4d1169d82e47 modify a
+  |   () draft
+  o  0:d3873e73d99e init
+      () public
+
+Bob pulling from private repo and pushing to the main public repo making the
+changeset public
 
   $ cd ../bob
   $ hg pull ../private
@@ -54,8 +80,13 @@
   added 1 changesets with 1 changes to 1 files
   new changesets 4d1169d82e47
   (run 'hg update' to get a working copy)
-  $ hg log -r 'draft()'
-  1:4d1169d82e47@default(draft) modify a
+
+  $ hg glog
+  o  1:4d1169d82e47 modify a
+  |   () draft
+  o  0:d3873e73d99e init
+      () public
+
   $ hg push ../public
   pushing to ../public
   searching for changes
@@ -63,7 +94,15 @@
   adding manifests
   adding file changes
   added 1 changesets with 1 changes to 1 files
-  $ hg log -r 'draft()'
+
+  $ hg glog
+  o  1:4d1169d82e47 modify a
+  |   () public
+  o  0:d3873e73d99e init
+      () public
+
+*But* Alice decided to amend the changeset she had and then pulling from public
+repo creating phase-divergent changeset locally
 
   $ cd ../alice
   $ hg amend -m 'tweak a'
@@ -73,13 +112,78 @@
   no changes found
   1 new phase-divergent changesets
 
-  $ hg evolve -a -A --phase-divergent
+  $ hg glog
+  @  2:98bb3a6cfe1a tweak a
+  |   () draft
+  | o  1:4d1169d82e47 modify a
+  |/    () public
+  o  0:d3873e73d99e init
+      () public
+
+Using evolve --list to list phase-divergent changesets
+------------------------------------------------------
+
+  $ hg evolve --list
+  98bb3a6cfe1a: tweak a
+    phase-divergent: 4d1169d82e47 (immutable precursor)
+  
+
+Trying to see instability on public changeset
+
+  $ hg evolve -r 4d1169d8 --list
+  4d1169d82e47: modify a
+  
+
+Understanding phasedivergence using obslog
+------------------------------------------
+
+  $ hg obslog -r . --all
+  @  98bb3a6cfe1a (2) tweak a
+  |
+  o  4d1169d82e47 (1) modify a
+       rewritten(description) as 98bb3a6cfe1a using amend by test (Thu Jan 01 00:00:00 1970 +0000)
+  
+Solving the phase divergence using evolve command
+--------------------------------------------------
+
+  $ hg evolve
+  nothing to evolve on current working copy parent
+  (do you want to use --phase-divergent)
+  [2]
+
+testing the --confirm option
+  $ hg evolve --phase-divergent --confirm <<EOF
+  > n
+  > EOF
+  recreate:[2] tweak a
+  atop:[1] modify a
+  perform evolve? [Ny] n
+  abort: evolve aborted by user
+  [255]
+
+testing the --dry-run option
+
+  $ hg evolve --phase-divergent --dry-run
+  recreate:[2] tweak a
+  atop:[1] modify a
+  hg rebase --rev 98bb3a6cfe1a --dest d3873e73d99e;
+  hg update 4d1169d82e47;
+  hg revert --all --rev 98bb3a6cfe1a;
+  hg commit --msg "phase-divergent update to 98bb3a6cfe1a"
+
+  $ hg evolve --phase-divergent
   recreate:[2] tweak a
   atop:[1] modify a
   computing new diff
   committed as 4d1169d82e47
   working directory is now at 4d1169d82e47
 
+  $ hg glog
+  @  1:4d1169d82e47 modify a
+  |   () public
+  o  0:d3873e73d99e init
+      () public
+
 Bumped Merge changeset:
 -----------------------