diff contrib/patchbomb @ 1604:da3f1121721b

add --plain option to patchbomb. this omits the hg patch headers. it makes a patchbomb email look like a regular email with a patch.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Wed, 28 Dec 2005 07:13:52 -0800
parents 5352a5407dc1
children
line wrap: on
line diff
--- a/contrib/patchbomb	Wed Dec 28 07:11:46 2005 -0800
+++ b/contrib/patchbomb	Wed Dec 28 07:13:52 2005 -0800
@@ -128,6 +128,10 @@
         #        'Patch subject is complete summary.')
         #body += '\n\n\n'
 
+        if opts['plain']:
+            while patch and patch[0].startswith('# '): patch.pop(0)
+            if patch: patch.pop(0)
+            while patch and not patch[0].strip(): patch.pop(0)
         if opts['diffstat']:
             body += cdiffstat('\n'.join(desc), patch) + '\n\n'
         body += '\n'.join(patch)
@@ -252,6 +256,7 @@
     optspec = [('c', 'cc', [], 'email addresses of copy recipients'),
                ('d', 'diffstat', None, 'add diffstat output to messages'),
                ('f', 'from', '', 'email address of sender'),
+               ('', 'plain', None, 'omit hg patch header'),
                ('n', 'test', None, 'print messages that would be sent'),
                ('s', 'subject', '', 'subject of introductory message'),
                ('t', 'to', [], 'email addresses of recipients')]