[PATCH 1 of 6 phases] phases: add a bit more test for local phase movement

pierre-yves.david at logilab.fr pierre-yves.david at logilab.fr
Mon Dec 19 04:46:47 CST 2011


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1324246512 -3600
# Node ID c320bc83c8c47c49414d09d1c1465aa0c9122511
# Parent  7b7f03502b5aa9cbe3fa254d9bedb70b4dd4d205
phases: add a bit more test for local phase movement.

diff --git a/tests/test-phases.t b/tests/test-phases.t
--- a/tests/test-phases.t
+++ b/tests/test-phases.t
@@ -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 first
+  0 1 A
+
+Following commit are draft too
+
+  $ mkcommit B
+
+  $ hglog
+  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


More information about the Mercurial-devel mailing list