Add test for patch.diff monkey
authorChristian Ebert <blacktrash@gmx.net>
Thu, 14 Feb 2008 13:30:17 +0100
changeset 409 6e2293f7b9f7
parent 408 33e5b8a51e47
child 410 64cd77f6f7f1
Add test for patch.diff monkey
tests/test-keyword
tests/test-keyword.out
--- a/tests/test-keyword	Thu Feb 14 13:26:51 2008 +0100
+++ b/tests/test-keyword	Thu Feb 14 13:30:17 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	Thu Feb 14 13:26:51 2008 +0100
+++ b/tests/test-keyword.out	Thu Feb 14 13:30:17 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