# HG changeset patch # User Mathieu Clabaut # Date 1180017158 -7200 # Node ID afa1f57ae484e398460e72f15d2fdd74dd6cff29 # Parent 671158f060cc2a0ea485067c403305bde632bd22 Add sending date to notify message. When using SMTP, no date field was set into the message, which causes it to be displayed as being send on 1st january 1970 on most MUA. diff -r 671158f060cc -r afa1f57ae484 hgext/notify.py --- a/hgext/notify.py Fri Jun 01 19:45:05 2007 +0200 +++ b/hgext/notify.py Thu May 24 16:32:38 2007 +0200 @@ -211,6 +211,8 @@ del msg['From'] msg['From'] = sender + msg['Date'] = util.datestr(date=util.makedate(), + format="%a, %d %b %Y %H:%M:%S", timezone=True) fix_subject() fix_sender() diff -r 671158f060cc -r afa1f57ae484 tests/test-notify --- a/tests/test-notify Fri Jun 01 19:45:05 2007 +0200 +++ b/tests/test-notify Thu May 24 16:32:38 2007 +0200 @@ -34,7 +34,8 @@ echo '% pull (minimal config)' hg --traceback --cwd b pull ../a 2>&1 | 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/^details: .*test-notify/details: test-notify/' \ + -e 's/^Date:.*/Date:/' cat <> $HGRCPATH [notify] @@ -50,5 +51,6 @@ 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/' + -e 's/changeset \([0-9a-f]*\) in .*/changeset \1/' \ + -e 's/^Date:.*/Date:/' diff -r 671158f060cc -r afa1f57ae484 tests/test-notify.out --- a/tests/test-notify.out Fri Jun 01 19:45:05 2007 +0200 +++ b/tests/test-notify.out Thu May 24 16:32:38 2007 +0200 @@ -13,6 +13,7 @@ adding manifests adding file changes added 1 changesets with 1 changes to 1 files +Date: Subject: changeset in test-notify/b: b From: test X-Hg-Notification: changeset 0647d048b600 @@ -41,6 +42,7 @@ adding manifests adding file changes added 1 changesets with 1 changes to 1 files +Date: Subject: b From: test@test.com X-Hg-Notification: changeset 0647d048b600