##// END OF EJS Templates
notify: fix neglect of custom headers set via template...
Christian Ebert -
r7673:af4871b7 default
parent child Browse files
Show More
@@ -185,10 +185,16 b' class notifier(object):'
185
185
186 # store sender and subject
186 # store sender and subject
187 sender, subject = msg['From'], msg['Subject']
187 sender, subject = msg['From'], msg['Subject']
188 del msg['From'], msg['Subject']
189 # store remaining headers
190 headers = msg.items()
188 # create fresh mime message from msg body
191 # create fresh mime message from msg body
189 text = msg.get_payload()
192 text = msg.get_payload()
190 # for notification prefer readability over data precision
193 # for notification prefer readability over data precision
191 msg = mail.mimeencode(self.ui, text, self.charsets, self.test)
194 msg = mail.mimeencode(self.ui, text, self.charsets, self.test)
195 # reinstate custom headers
196 for k, v in headers:
197 msg[k] = v
192
198
193 def fix_subject(subject):
199 def fix_subject(subject):
194 '''try to make subject line exist and be useful.'''
200 '''try to make subject line exist and be useful.'''
@@ -52,7 +52,7 b' cat <<EOF >> $HGRCPATH'
52 config = $HGTMP/.notify.conf
52 config = $HGTMP/.notify.conf
53 domain = test.com
53 domain = test.com
54 strip = 3
54 strip = 3
55 template = Subject: {desc|firstline|strip}\nFrom: {author}\n\nchangeset {node|short} in {webroot}\ndescription:\n\t{desc|tabindent|strip}
55 template = Subject: {desc|firstline|strip}\nFrom: {author}\nX-Test: foo\n\nchangeset {node|short} in {webroot}\ndescription:\n\t{desc|tabindent|strip}
56
56
57 [web]
57 [web]
58 baseurl = http://test/
58 baseurl = http://test/
@@ -108,6 +108,7 b' added 1 changesets with 1 changes to 1 f'
108 Content-Type: text/plain; charset="us-ascii"
108 Content-Type: text/plain; charset="us-ascii"
109 MIME-Version: 1.0
109 MIME-Version: 1.0
110 Content-Transfer-Encoding: 7bit
110 Content-Transfer-Encoding: 7bit
111 X-Test: foo
111 Date:
112 Date:
112 Subject: b
113 Subject: b
113 From: test@test.com
114 From: test@test.com
@@ -138,6 +139,7 b' added 1 changesets with 1 changes to 1 f'
138 Content-Type: text/plain; charset="us-ascii"
139 Content-Type: text/plain; charset="us-ascii"
139 MIME-Version: 1.0
140 MIME-Version: 1.0
140 Content-Transfer-Encoding: 7bit
141 Content-Transfer-Encoding: 7bit
142 X-Test: foo
141 Date:
143 Date:
142 Subject: b
144 Subject: b
143 From: test@test.com
145 From: test@test.com
General Comments 0
You need to be logged in to leave comments. Login now