commit: update test to actually modify template text
authorYuya Nishihara <yuya@tcha.org>
Fri, 06 Jan 2017 22:44:39 +0900
changeset 30723 6ef9f32d76c6
parent 30722 117e15c30e6c
child 30724 ee47e951c6f9
commit: update test to actually modify template text We have a check for unmodified commit message (introduced by bec1a579ebc4), which should be enabled for the "--- >8 ---" magic but currently not.
tests/test-commit.t
--- a/tests/test-commit.t	Mon Dec 26 00:25:44 2016 +0000
+++ b/tests/test-commit.t	Fri Jan 06 22:44:39 2017 +0900
@@ -692,6 +692,11 @@
 
 test that text below the --- >8 --- special string is ignored
 
+  $ cat <<'EOF' > $TESTTMP/lowercaseline.sh
+  > cat $1 | sed s/LINE/line/ | tee $1.new
+  > mv $1.new $1
+  > EOF
+
   $ hg init ignore_below_special_string
   $ cd ignore_below_special_string
   $ echo foo > foo
@@ -699,7 +704,7 @@
   $ hg commit -m "foo"
   $ cat >> .hg/hgrc <<EOF
   > [committemplate]
-  > changeset.commit = first line
+  > changeset.commit = first LINE
   >     HG: this is customized commit template
   >     HG: {extramsg}
   >     HG: ------------------------ >8 ------------------------
@@ -707,7 +712,7 @@
   > EOF
   $ echo foo2 > foo2
   $ hg add foo2
-  $ HGEDITOR=cat hg ci
+  $ HGEDITOR="sh $TESTTMP/lowercaseline.sh" hg ci
   first line
   HG: this is customized commit template
   HG: Leave message empty to abort commit.
@@ -725,7 +730,7 @@
 
   $ cat >> .hg/hgrc <<EOF
   > [committemplate]
-  > changeset.commit = first line2
+  > changeset.commit = first LINE2
   >     another line HG: ------------------------ >8 ------------------------
   >     HG: this is customized commit template
   >     HG: {extramsg}
@@ -733,7 +738,7 @@
   >     {diff()}
   > EOF
   $ echo foo >> foo
-  $ HGEDITOR=cat hg ci
+  $ HGEDITOR="sh $TESTTMP/lowercaseline.sh" hg ci
   first line2
   another line HG: ------------------------ >8 ------------------------
   HG: this is customized commit template
@@ -754,7 +759,7 @@
 
   $ cat >> .hg/hgrc <<EOF
   > [committemplate]
-  > changeset.commit = first line3
+  > changeset.commit = first LINE3
   >     HG: ------------------------ >8 ------------------------foobar
   >     second line
   >     HG: this is customized commit template
@@ -763,7 +768,7 @@
   >     {diff()}
   > EOF
   $ echo foo >> foo
-  $ HGEDITOR=cat hg ci
+  $ HGEDITOR="sh $TESTTMP/lowercaseline.sh" hg ci
   first line3
   HG: ------------------------ >8 ------------------------foobar
   second line