phases: test the new-commit option and proper inheritence of phase
authorPierre-Yves David <pierre-yves.david@ens-lyon.org>
Thu, 22 Dec 2011 00:40:46 +0100
changeset 15712 06b8b74720d6
parent 15711 c51c9dc13a58
child 15713 cff25e4b37d2
phases: test the new-commit option and proper inheritence of phase
tests/test-phases.t
--- a/tests/test-phases.t	Fri Dec 16 21:21:08 2011 +0900
+++ b/tests/test-phases.t	Thu Dec 22 00:40:46 2011 +0100
@@ -2,7 +2,9 @@
   $ mkcommit() {
   >    echo "$1" > "$1"
   >    hg add "$1"
-  >    hg ci -m "$1"
+  >    message="$1"
+  >    shift
+  >    hg ci -m "$message" $*
   > }
 
   $ hg init initialrepo
@@ -37,3 +39,52 @@
   2 1 C
   1 0 B
   0 0 A
+
+Test creating changeset as secret
+
+  $ mkcommit E --config phases.new-commit=2
+  $ hglog
+  4 2 E
+  3 1 D
+  2 1 C
+  1 0 B
+  0 0 A
+
+Test the secret property is inherited
+
+  $ mkcommit H
+  $ hglog
+  5 2 H
+  4 2 E
+  3 1 D
+  2 1 C
+  1 0 B
+  0 0 A
+
+Even on merge
+
+  $ hg up -q 1
+  $ mkcommit "B'"
+  created new head
+  $ hglog
+  6 1 B'
+  5 2 H
+  4 2 E
+  3 1 D
+  2 1 C
+  1 0 B
+  0 0 A
+  $ hg merge 4 # E
+  3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  (branch merge, don't forget to commit)
+  $ hg ci -m "merge B' and E"
+  $ hglog
+  7 2 merge B' and E
+  6 1 B'
+  5 2 H
+  4 2 E
+  3 1 D
+  2 1 C
+  1 0 B
+  0 0 A
+