phases: add a bit more test for local phase movement.
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Sun, 18 Dec 2011 23:15:12 +0100
changeset 15694 1e4e49c58b94
parent 15693 54f2205d8ea9
child 15695 1b9dcf2eb011
phases: add a bit more test for local phase movement.
tests/test-phases.t
--- a/tests/test-phases.t	Mon Dec 19 14:04:33 2011 -0600
+++ b/tests/test-phases.t	Sun Dec 18 23:15:12 2011 +0100
@@ -1,10 +1,39 @@
   $ alias hglog='hg log --template "{rev} {phase} {desc}\n"'
+  $ mkcommit() {
+  >    echo "$1" > "$1"
+  >    hg add "$1"
+  >    hg ci -m "$1"
+  > }
 
   $ hg init initialrepo
   $ cd initialrepo
-  $ touch sam
-  $ hg add sam
-  $ hg ci -m 'first'
+  $ mkcommit A
+
+New commit are draft by default
+
+  $ hglog
+  0 1 A
+
+Following commit are draft too
+
+  $ mkcommit B
 
   $ hglog
-  0 1 first
+  1 1 B
+  0 1 A
+
+Draft commit are properly created over public one:
+
+  $ hg pull -q . # XXX use the dedicated phase command once available
+  $ hglog
+  1 0 B
+  0 0 A
+
+  $ mkcommit C
+  $ mkcommit D
+
+  $ hglog
+  3 1 D
+  2 1 C
+  1 0 B
+  0 0 A