[PATCH] notify extension: truncate lines to 998 characters to conform to RFC 5322

Mads Kiilerich mads at kiilerich.com
Thu Oct 27 18:46:12 CDT 2011


(Discussing patch for http://mercurial.selenic.com/bts/issue3075 )

Matt Mackall wrote, On 10/27/2011 06:09 PM:
> But we've also got the patchbomb extension, which will have the same 
> issue.

Really? patchbomb uses mail.mimetextpatch which 3e544c074459 changed to 
handle odd patches correctly:

 >>> import mercurial.mail
 >>> print mercurial.mail.mimetextpatch('a\nb')
 From nobody Fri Oct 28 01:19:21 2011
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

a
b
 >>> print mercurial.mail.mimetextpatch('b\xc3\xb8b')
 From nobody Fri Oct 28 01:20:10 2011
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64

YsO4Yg==

 >>> print mercurial.mail.mimetextpatch('x'*951)
 From nobody Fri Oct 28 01:20:44 2011
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx


AFAICS everything would be fine if notify did like patchbomb.

This is also why http://mercurial.selenic.com/bts/issue2414 IMHO never 
was an issue.

A viable solution to http://mercurial.selenic.com/bts/issue2290 could 
perhaps be to also use mime or qp if '[^\n\t\x32-\x7e]' is found.

/Mads


More information about the Mercurial-devel mailing list