diff hgext/patchbomb.py @ 21282:697fba94dec9

patchbomb: includes series information in the header We includes information about the series being patch bombed in all email. Two new headers are added: * X-Mercurial-Series-Index: index of the patches in the series (starts at 1) * X-Mercurial-Series-Total: The total number of patches in the series This information is available in the email subject line, but having them formalized in the header will helps automated tools to process patches send with modern mercurial.
author Pierre-Yves David <pierre-yves.david@fb.com>
date Mon, 05 May 2014 22:47:14 -0700
parents dbff8c119cf6
children 36b31f7867a7
line wrap: on
line diff
--- a/hgext/patchbomb.py	Fri May 09 13:32:56 2014 -0500
+++ b/hgext/patchbomb.py	Mon May 05 22:47:14 2014 -0700
@@ -149,6 +149,8 @@
         subj = '[PATCH %0*d of %d%s] %s' % (tlen, idx, total, flag, subj)
     msg['Subject'] = mail.headencode(ui, subj, _charsets, opts.get('test'))
     msg['X-Mercurial-Node'] = node
+    msg['X-Mercurial-Series-Index'] = '%i' % idx
+    msg['X-Mercurial-Series-Total'] = '%i' % total
     return msg, subj, ds
 
 emailopts = [