Mercurial > hg
changeset 3740:aef384dbc731
add test for the notify extension
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Fri, 01 Dec 2006 01:29:13 -0600 |
parents | 16f8e7d1dd54 |
children | 0897bf8d54c7 |
files | tests/test-notify tests/test-notify.out |
diffstat | 2 files changed, 73 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-notify Fri Dec 01 01:29:13 2006 -0600 @@ -0,0 +1,38 @@ +#!/bin/sh + +cat <<EOF >> $HGRCPATH +[extensions] +notify= + +[hooks] +incoming.notify = python:hgext.notify.hook + +[notify] +config = $HGTMP/.notify.conf +sources = pull +domain = test.com +strip = 3 +template = Subject: {desc|firstline|strip}\nFrom: {author}\n\nchangeset {node|short} in {webroot}\ndescription:\n\t{desc|tabindent|strip} + +[web] +baseurl = http://test/ + +[usersubs] +foo@bar = * +EOF + +hg init a +echo a > a/a +echo % commit +hg --traceback --cwd a commit -Ama -d '0 0' + +echo % clone +hg --traceback clone a b + +echo a >> a/a +echo % commit +hg --traceback --cwd a commit -Amb -d '1 0' + +echo % pull +hg --traceback --cwd b pull ../a 2>&1 | sed -e 's/\(Message-Id:\).*/\1/' \ + -e 's/changeset \([0-9a-f]*\) in .*/changeset \1/'
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/test-notify.out Fri Dec 01 01:29:13 2006 -0600 @@ -0,0 +1,35 @@ +% commit +adding a +% clone +1 files updated, 0 files merged, 0 files removed, 0 files unresolved +% commit +% pull +pulling from ../a +searching for changes +adding changesets +adding manifests +adding file changes +added 1 changesets with 1 changes to 1 files +Subject: b +From: test@test.com +X-Hg-Notification: changeset 0647d048b600 +Message-Id: +To: 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 ++a +(run 'hg update' to get a working copy)