test-notify
100 lines
| 2.2 KiB
| text/plain
|
TextLexer
/ tests / test-notify
Matt Mackall
|
r3740 | #!/bin/sh | ||
cat <<EOF >> $HGRCPATH | ||||
[extensions] | ||||
notify= | ||||
[hooks] | ||||
incoming.notify = python:hgext.notify.hook | ||||
[notify] | ||||
sources = pull | ||||
Thomas Arendsen Hein
|
r3747 | diffstat = False | ||
Matt Mackall
|
r3740 | |||
[usersubs] | ||||
foo@bar = * | ||||
Alexis S. L. Carvalho
|
r4094 | |||
[reposubs] | ||||
* = baz | ||||
Matt Mackall
|
r3740 | EOF | ||
Benoit Boissinot
|
r4009 | hg help notify | ||
Matt Mackall
|
r3740 | 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' | ||||
Florent Guillaume
|
r6359 | # on Mac OS X 10.5 the tmp path is very long so would get stripped in the subject line | ||
cat <<EOF >> $HGRCPATH | ||||
[notify] | ||||
maxsubject = 200 | ||||
EOF | ||||
# the python call below wraps continuation lines, which appear on Mac OS X 10.5 because | ||||
# of the very long subject line | ||||
Alexis S. L. Carvalho
|
r4094 | echo '% pull (minimal config)' | ||
Florent Guillaume
|
r6359 | hg --traceback --cwd b pull ../a 2>&1 | | ||
python -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),' | | ||||
sed -e 's/\(Message-Id:\).*/\1/' \ | ||||
Thomas Arendsen Hein
|
r4157 | -e 's/changeset \([0-9a-f]* *\)in .*test-notif/changeset \1in test-notif/' \ | ||
Mathieu Clabaut
|
r4479 | -e 's/^details: .*test-notify/details: test-notify/' \ | ||
-e 's/^Date:.*/Date:/' | ||||
Alexis S. L. Carvalho
|
r4094 | |||
cat <<EOF >> $HGRCPATH | ||||
[notify] | ||||
config = $HGTMP/.notify.conf | ||||
domain = test.com | ||||
strip = 3 | ||||
Christian Ebert
|
r7658 | template = Subject: {desc|firstline|strip}\nFrom: {author}\nX-Test: foo\n\nchangeset {node|short} in {webroot}\ndescription:\n\t{desc|tabindent|strip} | ||
Alexis S. L. Carvalho
|
r4094 | |||
[web] | ||||
baseurl = http://test/ | ||||
EOF | ||||
Patrick Mezard
|
r4517 | echo % fail for config file is missing | ||
hg --cwd b rollback | ||||
hg --cwd b pull ../a 2>&1 | grep 'unable to open.*\.notify\.conf' > /dev/null && echo pull failed | ||||
touch "$HGTMP/.notify.conf" | ||||
Matt Mackall
|
r3740 | echo % pull | ||
Alexis S. L. Carvalho
|
r4094 | hg --cwd b rollback | ||
Matt Mackall
|
r3740 | hg --traceback --cwd b pull ../a 2>&1 | sed -e 's/\(Message-Id:\).*/\1/' \ | ||
Mathieu Clabaut
|
r4479 | -e 's/changeset \([0-9a-f]*\) in .*/changeset \1/' \ | ||
-e 's/^Date:.*/Date:/' | ||||
Alexis S. L. Carvalho
|
r4094 | |||
Dirkjan Ochtman
|
r7105 | 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/' \ | ||||
Thomas Arendsen Hein
|
r7172 | -e 's/^Date:.*/Date:/' | ||
Patrick Mezard
|
r7664 | |||
echo % test merge | ||||
cd a | ||||
hg up -C 0 | ||||
echo a >> a | ||||
hg ci -Am adda2 -d '2 0' | ||||
hg merge | ||||
hg ci -m merge -d '3 0' | ||||
cd .. | ||||
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:/' | ||||