[PATCH] patchbomb: option to set the name of bundle attachment (issue1452)
John Mulligan
phlogistonjohn at asynchrono.us
Sat Mar 14 09:47:38 CDT 2009
# HG changeset patch
# User John Mulligan <phlogistonjohn at asynchrono.us>
# Date 1237042008 14400
# Node ID 0d7ff1a72018c936de5480b7850ddb1143160940
# Parent a536b9a43227db025d0991c689ed844fe34e8279
patchbomb: option to set the name of bundle attachment (issue1452)
specifying --bundlename=NAME will create a "NAME.hg" attachment
diff --git a/hgext/patchbomb.py b/hgext/patchbomb.py
--- a/hgext/patchbomb.py
+++ b/hgext/patchbomb.py
@@ -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)')),
More information about the Mercurial-devel
mailing list