[PATCH] test-notify: make it pass on Mac OS X

Florent Guillaume fg at nuxeo.com
Wed Mar 19 18:35:27 CDT 2008


# HG changeset patch
# User Florent Guillaume <fg at nuxeo.com>
# Date 1205969613 -3600
# Node ID 35308737c2a4cb8fa84c7792a418877debf433c0
# Parent  577a7da1d44b68b7bfabdc0f5927710a44b6d82f
test-notify: make it pass on Mac OS X

diff --git a/tests/test-notify b/tests/test-notify
--- a/tests/test-notify
+++ b/tests/test-notify
@@ -31,8 +31,18 @@ echo % commit
 echo % commit
 hg --traceback --cwd a commit -Amb -d '1 0'
 
+# on Mac OS X 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 because
+# of the very long subject line
 echo '% pull (minimal config)'
-hg --traceback --cwd b pull ../a 2>&1 | sed -e 's/\(Message-Id:\).*/\1/' \
+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/' \
   -e 's/changeset \([0-9a-f]* *\)in .*test-notif/changeset \1in test-notif/' \
   -e 's/^details: .*test-notify/details: test-notify/' \
   -e 's/^Date:.*/Date:/'
diff --git a/tests/test-notify.out b/tests/test-notify.out
--- a/tests/test-notify.out
+++ b/tests/test-notify.out
@@ -22,8 +22,7 @@ To: baz, foo at bar
 
 changeset 0647d048b600 in test-notify/b
 details: test-notify/b?cmd=changeset;node=0647d048b600
-description:
-	b
+description: b
 
 diffs (6 lines):
 


More information about the Mercurial-devel mailing list