# HG changeset patch
# User Boris Feld
# Date 1499891988 -7200
# Wed Jul 12 22:39:48 2017 +0200
# Node ID 0ccb45f63c27d373c02a87e6544e684db27659fe
# Parent 14007d8eba4dd21240bb243e45394fa0dc70545b
# EXP-Topic tr.changes.phases
phases: test phases tracking at the transaction level
Now that we have all tracking in place, the data in `tr.changes['phases']`
dictionary should be correct and we should test it.
It is a bit late in the cycle to discuss to add any public API (eg: hooks)
that expose the data to the user, so we just add a small test extension
displaying the data. It is enabled for the phases tests.
New output have been manually checked for consistency.
diff -r 14007d8eba4d -r 0ccb45f63c27 tests/test-phases-exchange.t
--- a/tests/test-phases-exchange.t Wed Jul 12 20:11:00 2017 +0200
+++ b/tests/test-phases-exchange.t Wed Jul 12 22:39:48 2017 +0200
@@ -1,5 +1,10 @@
#require killdaemons
+ $ cat >> $HGRCPATH << EOF
+ > [extensions]
+ > phasereport=$TESTDIR/testlib/ext-phase-report.py
+ > EOF
+
$ hgph() { hg log -G --template "{rev} {phase} {desc} - {node|short}\n" $*; }
$ mkcommit() {
@@ -13,9 +18,13 @@
$ hg init alpha
$ cd alpha
$ mkcommit a-A
+ test-debug-phase: new rev 0: x -> 1
$ mkcommit a-B
+ test-debug-phase: new rev 1: x -> 1
$ mkcommit a-C
+ test-debug-phase: new rev 2: x -> 1
$ mkcommit a-D
+ test-debug-phase: new rev 3: x -> 1
$ hgph
@ 3 draft a-D - b555f63b6063
|
@@ -34,6 +43,10 @@
adding manifests
adding file changes
added 2 changesets with 2 changes to 2 files
+ test-debug-phase: new rev 0: x -> 0
+ test-debug-phase: new rev 1: x -> 0
+ test-debug-phase: move rev 0: 1 -> 0
+ test-debug-phase: move rev 1: 1 -> 0
$ hgph
@ 3 draft a-D - b555f63b6063
|
@@ -52,6 +65,7 @@
$ hg up -q
$ mkcommit b-A
+ test-debug-phase: new rev 2: x -> 1
$ hgph
@ 2 draft b-A - f54f1bb90ff3
|
@@ -66,6 +80,8 @@
adding manifests
adding file changes
added 2 changesets with 2 changes to 2 files (+1 heads)
+ test-debug-phase: new rev 3: x -> 0
+ test-debug-phase: new rev 4: x -> 0
(run 'hg heads' to see heads, 'hg merge' to merge)
$ hgph
o 4 public a-D - b555f63b6063
@@ -96,6 +112,7 @@
pushing to ../beta
searching for changes
no changes found
+ test-debug-phase: move rev 2: 1 -> 0
[1]
$ hgph
@ 3 draft a-D - b555f63b6063
@@ -110,6 +127,7 @@
pushing to ../beta
searching for changes
no changes found
+ test-debug-phase: move rev 3: 1 -> 0
[1]
$ hgph
@ 3 public a-D - b555f63b6063
@@ -130,6 +148,7 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
+ test-debug-phase: new rev 4: x -> 0
(run 'hg heads' to see heads, 'hg merge' to merge)
$ cd ../beta
@@ -148,6 +167,7 @@
pulling from ../alpha
searching for changes
no changes found
+ test-debug-phase: move rev 2: 1 -> 0
$ hgph
o 4 public a-D - b555f63b6063
|
@@ -182,6 +202,11 @@
adding manifests
adding file changes
added 5 changesets with 5 changes to 5 files (+1 heads)
+ test-debug-phase: new rev 0: x -> 1
+ test-debug-phase: new rev 1: x -> 1
+ test-debug-phase: new rev 2: x -> 1
+ test-debug-phase: new rev 3: x -> 1
+ test-debug-phase: new rev 4: x -> 1
(run 'hg heads' to see heads, 'hg merge' to merge)
$ hgph
o 4 draft a-D - b555f63b6063
@@ -210,6 +235,9 @@
adding manifests
adding file changes
added 3 changesets with 3 changes to 3 files
+ test-debug-phase: new rev 0: x -> 1
+ test-debug-phase: new rev 1: x -> 1
+ test-debug-phase: new rev 2: x -> 1
(run 'hg update' to get a working copy)
$ hgph
o 2 draft a-C - 54acac6f23ab
@@ -228,6 +256,7 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files (+1 heads)
+ test-debug-phase: new rev 3: x -> 1
(run 'hg heads' to see heads, 'hg merge' to merge)
$ hgph
o 3 draft b-A - f54f1bb90ff3
@@ -250,6 +279,10 @@
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
+ test-debug-phase: move rev 0: 1 -> 0
+ test-debug-phase: move rev 1: 1 -> 0
+ test-debug-phase: move rev 2: 1 -> 0
+ test-debug-phase: new rev 4: x -> 0
(run 'hg update' to get a working copy)
$ hgph # f54f1bb90ff3 stay draft, not ancestor of -r
o 4 public a-D - b555f63b6063
@@ -267,7 +300,9 @@
$ hg up -q f54f1bb90ff3
$ mkcommit n-A
+ test-debug-phase: new rev 5: x -> 1
$ mkcommit n-B
+ test-debug-phase: new rev 6: x -> 1
$ hgph
@ 6 draft n-B - 145e75495359
|
@@ -291,6 +326,12 @@
adding manifests
adding file changes
added 2 changesets with 2 changes to 2 files
+ test-debug-phase: move rev 0: 1 -> 0
+ test-debug-phase: move rev 1: 1 -> 0
+ test-debug-phase: move rev 3: 1 -> 0
+ test-debug-phase: move rev 4: 1 -> 0
+ test-debug-phase: new rev 5: x -> 1
+ test-debug-phase: new rev 6: x -> 1
(run 'hg update' to get a working