[PATCH 3 of 3] keyword: add test for patch.diff monkey

Christian Ebert blacktrash at gmx.net
Thu Feb 14 04:04:53 CST 2008


# HG changeset patch
# User Christian Ebert <blacktrash at gmx.net>
# Date 1202983462 -3600
# Node ID 90329e9bb0a15e4333b616389c165ec8d5d2cb64
# Parent  dcc5992e621e4fc80bafa21959a70bb2641465e6
keyword: add test for patch.diff monkey

diff --git a/tests/test-keyword b/tests/test-keyword
--- a/tests/test-keyword
+++ b/tests/test-keyword
@@ -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
diff --git a/tests/test-keyword.out b/tests/test-keyword.out
--- a/tests/test-keyword.out
+++ b/tests/test-keyword.out
@@ -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


More information about the Mercurial-devel mailing list