[PATCH 2 of 2] test-notify: make it pass on Mac OS X (again)

Dan Villiom Podlaski Christiansen danchr at gmail.com
Fri Aug 13 10:23:33 CDT 2010


# HG changeset patch
# User Dan Villiom Podlaski Christiansen <danchr at gmail.com>
# Date 1281712866 -7200
# Node ID 22287abb27fdb5240c8874e061a8b2ce65c16089
# Parent  16895d9521f623b6e5b13331c85c1fb59a0880a6
test-notify: make it pass on Mac OS X (again)

Changeset 25e74cd3f023 (from 2008) introduced a hack to handle the
very long values of $TMPDIR typically seen on Mac OS X. This hack
expected continuation lines to begin with a tab. However, as a result
of a change in Python 2.7, changeset 594b98846ce1 made it so
continuation lines began with a tab. Since then, `test-notify' has
been broken on Mac OS X.

Merely replacing the tab in the regular expression with a space will
not work: not only do tab continuations still occur in the message, but
other lines -- in the body of the message -- also start with a
space. Luckily, all broken up lines appear to end with either a colon
or an n, so we can match those, and reinsert them in the replacement.

diff --git a/tests/test-notify b/tests/test-notify
--- a/tests/test-notify
+++ b/tests/test-notify
@@ -41,7 +41,7 @@ EOF
 # of the very long subject line
 echo '% pull (minimal config)'
 hg --traceback --cwd b pull ../a 2>&1 |
-  python -c 'import sys,re; print re.sub("\n\t", " ", sys.stdin.read()),' |
+  python -c 'import sys,re; print re.sub("([n:])\\n[\\t ]", "\\1 ", 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/' \


More information about the Mercurial-devel mailing list