changeset 7105:31837416ef4d

tests: add some testing for patch.diffstat()
author Dirkjan Ochtman <dirkjan@ochtman.nl>
date Fri, 17 Oct 2008 17:34:25 +0200
parents 9514cbb6e4f6
children 4674706b5b95
files tests/test-notify tests/test-notify.out
diffstat 2 files changed, 46 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-notify	Tue Oct 14 20:13:53 2008 +0200
+++ b/tests/test-notify	Fri Oct 17 17:34:25 2008 +0200
@@ -70,3 +70,17 @@
   -e 's/changeset \([0-9a-f]*\) in .*/changeset \1/' \
   -e 's/^Date:.*/Date:/'
 
+cat << EOF >> $HGRCPATH
+[hooks]
+incoming.notify = python:hgext.notify.hook
+
+[notify]
+sources = pull
+diffstat = True
+EOF
+
+echo % pull
+hg --cwd b rollback
+hg --traceback --cwd b pull ../a 2>&1 | sed -e 's/\(Message-Id:\).*/\1/' \
+  -e 's/changeset \([0-9a-f]*\) in .*/changeset \1/' \
+  -e 's/^Date:.*/Date:/'
--- a/tests/test-notify.out	Tue Oct 14 20:13:53 2008 +0200
+++ b/tests/test-notify.out	Fri Oct 17 17:34:25 2008 +0200
@@ -64,3 +64,35 @@
  a
 +a
 (run 'hg update' to get a working copy)
+% pull
+rolling back last transaction
+pulling from ../a
+searching for changes
+adding changesets
+adding manifests
+adding file changes
+added 1 changesets with 1 changes to 1 files
+Date:
+Subject: b
+From: test@test.com
+X-Hg-Notification: changeset 0647d048b600
+Message-Id:
+To: baz@test.com, foo@bar
+
+changeset 0647d048b600
+description:
+	b
+diffstat:
+
+1 file changed, 1 insertion(+)
+a |    1 +
+
+diffs (6 lines):
+
+diff -r cb9a9f314b8b -r 0647d048b600 a
+--- a/a	Thu Jan 01 00:00:00 1970 +0000
++++ b/a	Thu Jan 01 00:00:01 1970 +0000
+@@ -1,1 +1,2 @@
+ a
++a
+(run 'hg update' to get a working copy)