patchbomb: option to set the name of bundle attachment (
issue1452)
specifying --bundlename=NAME will create a "NAME.hg" attachment
--- a/hgext/patchbomb.py Tue Mar 24 16:41:41 2009 -0500
+++ b/hgext/patchbomb.py Sat Mar 14 10:46:48 2009 -0400
@@ -344,8 +344,9 @@
msg.attach(mail.mimeencode(ui, body, _charsets, opts.get('test')))
datapart = email.MIMEBase.MIMEBase('application', 'x-mercurial-bundle')
datapart.set_payload(bundle)
+ bundlename = '%s.hg' % opts.get('bundlename', 'bundle')
datapart.add_header('Content-Disposition', 'attachment',
- filename='bundle.hg')
+ filename=bundlename)
email.Encoders.encode_base64(datapart)
msg.attach(datapart)
msg['Subject'] = mail.headencode(ui, subj, _charsets, opts.get('test'))
@@ -468,6 +469,8 @@
_('send changes not found in the target repository')),
('b', 'bundle', None,
_('send changes not in target as a binary bundle')),
+ ('', 'bundlename', 'bundle',
+ _('file name of the bundle attachment')),
('r', 'rev', [], _('a revision to send')),
('', 'force', None,
_('run even when remote repository is unrelated (with -b)')),