[PATCH] patchbomb: add user agent header to mails

Henrik Stuart hg at hstuart.dk
Wed Apr 22 13:47:42 CDT 2009


# HG changeset patch
# User Henrik Stuart <hg at hstuart.dk>
# Date 1240426029 -7200
# Node ID 87ffda90c838b2c67b4642a0f96ff62533b5de29
# Parent  c11636f0609effbb14964a6e8939c2e2d3453450
patchbomb: add user agent header to mails

diff -r c11636f0609e -r 87ffda90c838 hgext/patchbomb.py
--- a/hgext/patchbomb.py	Wed Apr 22 09:11:46 2009 +0200
+++ b/hgext/patchbomb.py	Wed Apr 22 20:47:09 2009 +0200
@@ -399,6 +399,7 @@
             m['References'] = parent
         else:
             parent = m['Message-Id']
+        m['User-Agent'] = 'Mercurial patchbomb/%s' % util.version()
         m['Date'] = util.datestr(start_time, "%a, %d %b %Y %H:%M:%S %1%2")
 
         start_time = (start_time[0] + 1, start_time[1])
diff -r c11636f0609e -r 87ffda90c838 tests/test-patchbomb
--- a/tests/test-patchbomb	Wed Apr 22 09:11:46 2009 +0200
+++ b/tests/test-patchbomb	Wed Apr 22 20:47:09 2009 +0200
@@ -5,6 +5,7 @@
     sed -e 's/\(Message-Id:.*@\).*/\1/'  \
         -e 's/\(In-Reply-To:.*@\).*/\1/' \
         -e 's/\(References:.*@\).*/\1/'  \
+        -e 's/\(User-Agent:.*\)\/.*/\1/'  \
         -e 's/===.*/===/'
 }
 
diff -r c11636f0609e -r 87ffda90c838 tests/test-patchbomb.out
--- a/tests/test-patchbomb.out	Wed Apr 22 09:11:46 2009 +0200
+++ b/tests/test-patchbomb.out	Wed Apr 22 20:47:09 2009 +0200
@@ -9,6 +9,7 @@
 Subject: [PATCH] a
 X-Mercurial-Node: 8580ff50825a50c8f716709acdf8de0deddcd6ab
 Message-Id: <8580ff50825a50c8f716.60@
+User-Agent: Mercurial patchbomb
 Date: Thu, 01 Jan 1970 00:01:00 +0000
 From: quux
 To: foo
@@ -40,6 +41,7 @@
 Content-Transfer-Encoding: 7bit
 Subject: [PATCH 0 of 2] test
 Message-Id: <patchbomb.120@
+User-Agent: Mercurial patchbomb
 Date: Thu, 01 Jan 1970 00:02:00 +0000
 From: quux
 To: foo
@@ -55,6 +57,7 @@
 Message-Id: <8580ff50825a50c8f716.121@
 In-Reply-To: <patchbomb.120@
 References: <patchbomb.120@
+User-Agent: Mercurial patchbomb
 Date: Thu, 01 Jan 1970 00:02:01 +0000
 From: quux
 To: foo
@@ -82,6 +85,7 @@
 Message-Id: <97d72e5f12c7e84f8506.122@
 In-Reply-To: <patchbomb.120@
 References: <patchbomb.120@
+User-Agent: Mercurial patchbomb
 Date: Thu, 01 Jan 1970 00:02:02 +0000
 From: quux
 To: foo
@@ -119,6 +123,7 @@
 MIME-Version: 1.0
 Subject: test
 Message-Id: <patchbomb.180@
+User-Agent: Mercurial patchbomb
 Date: Thu, 01 Jan 1970 00:03:00 +0000
 From: quux
 To: foo
@@ -152,7 +157,7 @@
 adding utf
 % no mime encoding for email --test
 % md5sum of 8-bit output
-ad877786716d09fd7843cf0ed5e3d2a8  mailtest
+64580820d47a7898d8e265f34bc7128e  mailtest
 % mime encoded mbox
 This patch series consists of 1 patches.
 
@@ -165,6 +170,7 @@
 Subject: [PATCH] charset=utf-8; content-transfer-encoding: base64
 X-Mercurial-Node: c3c9e37db9f4fe4882cda39baf42fed6bad8b15a
 Message-Id: <c3c9e37db9f4fe4882cd.240@
+User-Agent: Mercurial patchbomb
 Date: Thu, 01 Jan 1970 00:04:00 +0000
 From: quux
 To: foo
@@ -190,7 +196,7 @@
 
 Writing [PATCH] charset=us-ascii; content-transfer-encoding: 8bit ...
 % md5sum of 8-bit output
-90fae277a4a85255e8262174fcefb59f  mboxfix
+ff6d8fa2cf97d0f02df6817388a052d7  mboxfix
 % test diffstat for single patch
 This patch series consists of 1 patches.
 
@@ -207,6 +213,7 @@
 Subject: [PATCH] test
 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
 Message-Id: <ff2c9fa2018b15fa74b3.60@
+User-Agent: Mercurial patchbomb
 Date: Thu, 01 Jan 1970 00:01:00 +0000
 From: quux
 To: foo
@@ -258,6 +265,7 @@
 Content-Transfer-Encoding: 7bit
 Subject: [PATCH 0 of 2] test
 Message-Id: <patchbomb.60@
+User-Agent: Mercurial patchbomb
 Date: Thu, 01 Jan 1970 00:01:00 +0000
 From: quux
 To: foo
@@ -277,6 +285,7 @@
 Message-Id: <8580ff50825a50c8f716.61@
 In-Reply-To: <patchbomb.60@
 References: <patchbomb.60@
+User-Agent: Mercurial patchbomb
 Date: Thu, 01 Jan 1970 00:01:01 +0000
 From: quux
 To: foo
@@ -308,6 +317,7 @@
 Message-Id: <97d72e5f12c7e84f8506.62@
 In-Reply-To: <patchbomb.60@
 References: <patchbomb.60@
+User-Agent: Mercurial patchbomb
 Date: Thu, 01 Jan 1970 00:01:02 +0000
 From: quux
 To: foo
@@ -340,6 +350,7 @@
 Subject: [PATCH] test
 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
 Message-Id: <ff2c9fa2018b15fa74b3.60@
+User-Agent: Mercurial patchbomb
 Date: Thu, 01 Jan 1970 00:01:00 +0000
 From: quux
 To: foo
@@ -378,6 +389,7 @@
 Content-Transfer-Encoding: 7bit
 Subject: [PATCH 0 of 2] test
 Message-Id: <patchbomb.60@
+User-Agent: Mercurial patchbomb
 Date: Thu, 01 Jan 1970 00:01:00 +0000
 From: quux
 To: foo
@@ -392,6 +404,7 @@
 Message-Id: <8580ff50825a50c8f716.61@
 In-Reply-To: <patchbomb.60@
 References: <patchbomb.60@
+User-Agent: Mercurial patchbomb
 Date: Thu, 01 Jan 1970 00:01:01 +0000
 From: quux
 To: foo
@@ -425,6 +438,7 @@
 Message-Id: <97d72e5f12c7e84f8506.62@
 In-Reply-To: <patchbomb.60@
 References: <patchbomb.60@
+User-Agent: Mercurial patchbomb
 Date: Thu, 01 Jan 1970 00:01:02 +0000
 From: quux
 To: foo
@@ -460,6 +474,7 @@
 Subject: [PATCH] test
 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
 Message-Id: <ff2c9fa2018b15fa74b3.60@
+User-Agent: Mercurial patchbomb
 Date: Thu, 01 Jan 1970 00:01:00 +0000
 From: quux
 To: foo
@@ -507,6 +522,7 @@
 Content-Transfer-Encoding: 7bit
 Subject: [PATCH 0 of 2] test
 Message-Id: <patchbomb.60@
+User-Agent: Mercurial patchbomb
 Date: Thu, 01 Jan 1970 00:01:00 +0000
 From: quux
 To: foo
@@ -521,6 +537,7 @@
 Message-Id: <8580ff50825a50c8f716.61@
 In-Reply-To: <patchbomb.60@
 References: <patchbomb.60@
+User-Agent: Mercurial patchbomb
 Date: Thu, 01 Jan 1970 00:01:01 +0000
 From: quux
 To: foo
@@ -563,6 +580,7 @@
 Message-Id: <97d72e5f12c7e84f8506.62@
 In-Reply-To: <patchbomb.60@
 References: <patchbomb.60@
+User-Agent: Mercurial patchbomb
 Date: Thu, 01 Jan 1970 00:01:02 +0000
 From: quux
 To: foo
@@ -610,6 +628,7 @@
 Content-Transfer-Encoding: 7bit
 Subject: [PATCH 0 of 1] test
 Message-Id: <patchbomb.60@
+User-Agent: Mercurial patchbomb
 Date: Thu, 01 Jan 1970 00:01:00 +0000
 From: quux
 To: foo
@@ -625,6 +644,7 @@
 Message-Id: <ff2c9fa2018b15fa74b3.61@
 In-Reply-To: <patchbomb.60@
 References: <patchbomb.60@
+User-Agent: Mercurial patchbomb
 Date: Thu, 01 Jan 1970 00:01:01 +0000
 From: quux
 To: foo
@@ -656,6 +676,7 @@
 Content-Transfer-Encoding: 7bit
 Subject: [PATCH 0 of 2] test
 Message-Id: <patchbomb.60@
+User-Agent: Mercurial patchbomb
 Date: Thu, 01 Jan 1970 00:01:00 +0000
 From: quux
 To: foo
@@ -671,6 +692,7 @@
 Message-Id: <8580ff50825a50c8f716.61@
 In-Reply-To: <patchbomb.60@
 References: <patchbomb.60@
+User-Agent: Mercurial patchbomb
 Date: Thu, 01 Jan 1970 00:01:01 +0000
 From: quux
 To: foo
@@ -698,6 +720,7 @@
 Message-Id: <97d72e5f12c7e84f8506.62@
 In-Reply-To: <patchbomb.60@
 References: <patchbomb.60@
+User-Agent: Mercurial patchbomb
 Date: Thu, 01 Jan 1970 00:01:02 +0000
 From: quux
 To: foo
@@ -727,6 +750,7 @@
 Subject: [PATCH] test
 X-Mercurial-Node: ff2c9fa2018b15fa74b33363bda9527323e2a99f
 Message-Id: <ff2c9fa2018b15fa74b3.60@
+User-Agent: Mercurial patchbomb
 Date: Thu, 01 Jan 1970 00:01:00 +0000
 From: quux
 To: foo
@@ -765,6 +789,7 @@
 Content-Transfer-Encoding: 7bit
 Subject: [PATCH 0 of 2] test
 Message-Id: <patchbomb.60@
+User-Agent: Mercurial patchbomb
 Date: Thu, 01 Jan 1970 00:01:00 +0000
 From: quux
 To: foo
@@ -779,6 +804,7 @@
 Message-Id: <8580ff50825a50c8f716.61@
 In-Reply-To: <patchbomb.60@
 References: <patchbomb.60@
+User-Agent: Mercurial patchbomb
 Date: Thu, 01 Jan 1970 00:01:01 +0000
 From: quux
 To: foo
@@ -812,6 +838,7 @@
 Message-Id: <97d72e5f12c7e84f8506.62@
 In-Reply-To: <patchbomb.60@
 References: <patchbomb.60@
+User-Agent: Mercurial patchbomb
 Date: Thu, 01 Jan 1970 00:01:02 +0000
 From: quux
 To: foo
@@ -850,6 +877,7 @@
 Message-Id: <2c502b2db30e1ddd5e4e.60@
 In-Reply-To: baz
 References: baz
+User-Agent: Mercurial patchbomb
 Date: Thu, 01 Jan 1970 00:01:00 +0000
 From: quux
 To: foo


More information about the Mercurial-devel mailing list