Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
21281:bcddddcf0b54 | 21282:697fba94dec9 |
---|---|
147 else: | 147 else: |
148 tlen = len(str(total)) | 148 tlen = len(str(total)) |
149 subj = '[PATCH %0*d of %d%s] %s' % (tlen, idx, total, flag, subj) | 149 subj = '[PATCH %0*d of %d%s] %s' % (tlen, idx, total, flag, subj) |
150 msg['Subject'] = mail.headencode(ui, subj, _charsets, opts.get('test')) | 150 msg['Subject'] = mail.headencode(ui, subj, _charsets, opts.get('test')) |
151 msg['X-Mercurial-Node'] = node | 151 msg['X-Mercurial-Node'] = node |
152 msg['X-Mercurial-Series-Index'] = '%i' % idx | |
153 msg['X-Mercurial-Series-Total'] = '%i' % total | |
152 return msg, subj, ds | 154 return msg, subj, ds |
153 | 155 |
154 emailopts = [ | 156 emailopts = [ |
155 ('', 'body', None, _('send patches as inline message text (default)')), | 157 ('', 'body', None, _('send patches as inline message text (default)')), |
156 ('a', 'attach', None, _('send patches as attachments')), | 158 ('a', 'attach', None, _('send patches as attachments')), |