annotate tests/test-notify @ 4359:2e3c54fb79a3

actually port simplemerge to hg - use bdiff instead of patiencediff; this is a larger change, since bdiff works on 2 multi-line strings, while patiencediff works on 2 lists; - rename the main class from Merge3 to Merge3Text and add a Merge3 class that derives from Merge3Text. This new Merge3 class has the same interface from the original class, so that the tests still work; - Merge3 uses util.binary to detect binary data and raises util.Abort instead of a specific exception; - don't use the @decorator syntax, to keep python2.3 compatibility; - the test uses unittest, which likes to print how long it took to run. This obviously doesn't play too well with hg's test suite, so we override time.time to fool unittest; - one test has a different (but still valid) output because of the different diff algorithm used; - the TestCase class used by bzr has some extras to help debugging. test-merge3.py used 2 of them: - log method to log some data - assertEqualDiff method to ease viewing diffs of diffs We add a dummy log method and use regular assertEquals instead of assertEqualDiff. - make simplemerge executable and add "#!/usr/bin/env python" header
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Mon, 16 Apr 2007 20:17:39 -0300
parents bfeff6dcac7a
children afa1f57ae484
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3740
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
1 #!/bin/sh
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
2
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
3 cat <<EOF >> $HGRCPATH
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
4 [extensions]
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
5 notify=
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
6
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
7 [hooks]
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
8 incoming.notify = python:hgext.notify.hook
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
9
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
10 [notify]
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
11 sources = pull
3747
b5c4d749f37f Fix test-notify for systems without or with a different version of diffstat.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 3740
diff changeset
12 diffstat = False
3740
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
13
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
14 [usersubs]
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
15 foo@bar = *
4094
fbf0e9acfd83 notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4009
diff changeset
16
fbf0e9acfd83 notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4009
diff changeset
17 [reposubs]
fbf0e9acfd83 notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4009
diff changeset
18 * = baz
3740
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
19 EOF
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
20
4009
86098ec4b77a fix hg help <ext> for extension that do not define any command
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents: 3747
diff changeset
21 hg help notify
3740
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
22 hg init a
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
23 echo a > a/a
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
24 echo % commit
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
25 hg --traceback --cwd a commit -Ama -d '0 0'
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
26
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
27 echo % clone
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
28 hg --traceback clone a b
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
29
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
30 echo a >> a/a
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
31 echo % commit
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
32 hg --traceback --cwd a commit -Amb -d '1 0'
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
33
4094
fbf0e9acfd83 notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4009
diff changeset
34 echo '% pull (minimal config)'
fbf0e9acfd83 notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4009
diff changeset
35 hg --traceback --cwd b pull ../a 2>&1 | sed -e 's/\(Message-Id:\).*/\1/' \
4157
bfeff6dcac7a Fix sed expression in test-notify to be more portable.
Thomas Arendsen Hein <thomas@intevation.de>
parents: 4106
diff changeset
36 -e 's/changeset \([0-9a-f]* *\)in .*test-notif/changeset \1in test-notif/' \
4094
fbf0e9acfd83 notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4009
diff changeset
37 -e 's/^details: .*test-notify/details: test-notify/'
fbf0e9acfd83 notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4009
diff changeset
38
fbf0e9acfd83 notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4009
diff changeset
39 cat <<EOF >> $HGRCPATH
fbf0e9acfd83 notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4009
diff changeset
40 [notify]
fbf0e9acfd83 notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4009
diff changeset
41 config = $HGTMP/.notify.conf
fbf0e9acfd83 notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4009
diff changeset
42 domain = test.com
fbf0e9acfd83 notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4009
diff changeset
43 strip = 3
fbf0e9acfd83 notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4009
diff changeset
44 template = Subject: {desc|firstline|strip}\nFrom: {author}\n\nchangeset {node|short} in {webroot}\ndescription:\n\t{desc|tabindent|strip}
fbf0e9acfd83 notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4009
diff changeset
45
fbf0e9acfd83 notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4009
diff changeset
46 [web]
fbf0e9acfd83 notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4009
diff changeset
47 baseurl = http://test/
fbf0e9acfd83 notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4009
diff changeset
48 EOF
fbf0e9acfd83 notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4009
diff changeset
49
3740
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
50 echo % pull
4094
fbf0e9acfd83 notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4009
diff changeset
51 hg --cwd b rollback
3740
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
52 hg --traceback --cwd b pull ../a 2>&1 | sed -e 's/\(Message-Id:\).*/\1/' \
aef384dbc731 add test for the notify extension
Matt Mackall <mpm@selenic.com>
parents:
diff changeset
53 -e 's/changeset \([0-9a-f]*\) in .*/changeset \1/'
4094
fbf0e9acfd83 notify: don't try to fix addresses if notify.domain is not set
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4009
diff changeset
54