[PATCH] A new version of the base64 patch that does not spill a -j option on
Pjotr Kourzanov
peter.kourzanov at xs4all.nl
Mon Jun 2 07:42:04 CDT 2008
Patrick,
There is just one configuration option introduced here
(email.encoding). I saw both email and patchbomb used as
section names elsewhere therefore I couldn't decide.
Making it a global [default] would look a little strange,
no?
[default]
encoding=base64 #what is encoded here???
Your other suggestion could work, however, the only
useful application of --base64 is when it is applied to
an attachment (a real proper attachment). Matt didn't
like a global option for this (-A in the original patch),
so I made this a sub-option of -a.
Pjotr
P.S. This is BTW taking so long that the usefulness of
this match diminishes... C'mon we're talking about
5 bloody lines of Python (additional lines, mind
you) here...
On Fri, 2008-05-30 at 19:43 +0200, Patrick Mézard wrote:
> peter.kourzanov at xs4all.nl a écrit :
> > # HG changeset patch
> > # User pjotr kourzanov <peter.kourzanov at xs4all.nl>
> > # Date 1211407944 -7200
> > # Node ID 26b6a79a82015f502b31ae09b1d71c68a6e7e9ec
> > # Parent 9002bfa09fe416105ee6e4a0d3915ab7d93ac012
> > A new version of the base64 patch that does not spill a -j option on
> > --base64
> >
> > diff -r 9002bfa09fe4 -r 26b6a79a8201 hgext/patchbomb.py
> > --- a/hgext/patchbomb.py Thu May 22 00:11:43 2008 +0200
> > +++ b/hgext/patchbomb.py Thu May 22 00:12:24 2008 +0200
> > @@ -196,6 +196,11 @@
> > if opts['attach']:
> > disposition = 'attachment'
> > p['Content-Disposition'] = disposition + '; filename=' + patchname
> > + if not opts.get('inline') and (\
> > + opts.get('base64') or\
> > + ui.config('email', 'encoding')=='base64' or\
> > + ui.config('patchbomb', 'encoding')=='base64'):
>
> Boths configuration options are new right ? I am not convinced they are worth the trouble. [defaults] or the alias extension should be enough to handle these, aren't they ?
>
> > + email.Encoders.encode_base64(p)
> > msg.attach(p)
> > else:
> > body += '\n'.join(patch)
> > @@ -441,6 +446,7 @@
> > (patchbomb,
> > [('a', 'attach', None, _('send patches as attachments')),
> > ('i', 'inline', None, _('send patches as inline attachments')),
> > + ('', 'base64', None, _('encode patches with base64 (requires sending them as attachments)')),
>
> What about getting rid of the condition and say that --base64 implies --inline ? I think this behaviour would be less error prone, I suppose people know they want to send patches in base64, and they don't really care whether the attachment should be inline or not.
>
> > ('', 'bcc', [], _('email addresses of blind copy recipients')),
> > ('c', 'cc', [], _('email addresses of copy recipients')),
> > ('d', 'diffstat', None, _('add diffstat output to messages')),
>
> --
> Patrick Mézard
>
More information about the Mercurial-devel
mailing list