keyword: add test for patch.diff monkey
authorChristian Ebert <blacktrash@gmx.net>
Fri, 15 Feb 2008 18:36:49 +0100
changeset 6116 e27f39865d7e
parent 6115 8121e9d7bfd2
child 6117 c74f1d9092f8
keyword: add test for patch.diff monkey
tests/test-keyword
tests/test-keyword.out
--- a/tests/test-keyword	Fri Feb 15 18:36:28 2008 +0100
+++ b/tests/test-keyword	Fri Feb 15 18:36:49 2008 +0100
@@ -4,6 +4,7 @@
 [extensions]
 hgext.keyword =
 hgext.mq =
+hgext.notify =
 [keyword]
 * =
 b = ignore
@@ -88,8 +89,25 @@
 hg init Test
 cd Test
 
+echo % notify on pull to check whether keywords stay as is in email
+echo % ie. if patch.diff wrapper acts as it should
+
+cat <<EOF >> $HGRCPATH
+[hooks]
+incoming.notify = python:hgext.notify.hook
+[notify]
+sources = pull
+diffstat = False
+[reposubs]
+* = Test
+EOF
+
 echo % pull from bundle
-hg pull -u ../kw.hg
+hg pull -u ../kw.hg 2>&1 | sed -e '/^Date:/,/^diffs (/ d'
+
+echo % remove notify config
+sed -e '/\[hooks\]/,$ d' $HGRCPATH > $HGRCPATH.nonotify
+mv $HGRCPATH.nonotify $HGRCPATH
 
 echo % touch
 touch a b
--- a/tests/test-keyword.out	Fri Feb 15 18:36:28 2008 +0100
+++ b/tests/test-keyword.out	Fri Feb 15 18:36:49 2008 +0100
@@ -136,6 +136,8 @@
 % removing commit hook from config
 % bundle
 2 changesets found
+% notify on pull to check whether keywords stay as is in email
+% ie. if patch.diff wrapper acts as it should
 % pull from bundle
 pulling from ../kw.hg
 requesting all changes
@@ -143,7 +145,28 @@
 adding manifests
 adding file changes
 added 2 changesets with 3 changes to 3 files
+
+diff -r 000000000000 -r a2392c293916 sym
+--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
++++ b/sym	Sat Feb 09 20:25:47 2008 +0100
+@@ -0,0 +1,1 @@
++a
+\ No newline at end of file
+
+diff -r a2392c293916 -r ef63ca68695b a
+--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
++++ b/a	Thu Jan 01 00:00:00 1970 +0000
+@@ -0,0 +1,3 @@
++expand $Id$
++do not process $Id:
++xxx $
+diff -r a2392c293916 -r ef63ca68695b b
+--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
++++ b/b	Thu Jan 01 00:00:00 1970 +0000
+@@ -0,0 +1,1 @@
++ignore $Id$
 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
+% remove notify config
 % touch
 % status
 % update