[PATCH] patchbomb: option to set the name of bundle attachment (issue1452)

John Mulligan phlogistonjohn at asynchrono.us
Mon Mar 23 08:29:35 CDT 2009


On 2009-03-14 10:47:38 John Mulligan wrote:
> # 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

I'm bumping this now that 1.2.1 is out. 
Is anyone interested in this enhancement? It provides one of the two features 
requested in issue1452, the changing of the attachment name of mailed bundles.

>
> 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)')),
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel



More information about the Mercurial-devel mailing list