The "Notify" extension has a bug around line 218 where it tries to shorten the subject by chopping symbols off the end. The code works correctly with plain English/ASCII yet breaks legitimate UTF-8 comments: 1) subject = subject[:maxsubject - 3] + '...' - this line can cut in the middle of a multi-byte symbol - the code can only work with ASCII 2) mail.headencode(self.ui, subject, self.charsets, self.test) - this call fails to detect encoding - and spits out bytes encoded/transcoded in some weird way 3) the final result - rubbish in email subjects
Posted a patch to mercurial-devel: http://thread.gmane.org/gmane.comp.version-control.mercurial.devel/37078 Could you try it?
I certainly can try it. Could you explain how I can patch my existing Debian installation please? I am using a binary package from the "experimental" sub- distro which, I believe, contains compiled .pyc files...
> I certainly can try it. Could you explain how I can patch my existing Debian installation please? Hmm, clone http://selenic.com/repo/hg#stable and apply patches. Then, use the patched notify extension in place of debian package's: [extensions] notify = /path/to/patched/hg/hgext/notify.py
> Then, use the patched notify extension in place of debian package's: Ah, no, this won't work because I modified util.py. The easiest way is to use source install instead of packaged Mercurial: $ hg clone http://selenic.com/repo/hg#stable $ cd hg # apply patches # make local
Hmm... the install from source is not an acceptable option as it will force me to manually maintain the Mercurial application from this point on. I will test your code if you can provide the extension that I can temporary install and then roll back at will. Say, could you give me the notify.py file with a local copy of the elipsis() function please?
Fixed by http://selenic.com/repo/hg/rev/e3bf16703e26 Yuya Nishihara <yuya@tcha.org> util: fix ellipsis() not to break multi-byte sequence (issue2564) (please test the fix)
--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:15 EDT --- This bug was previously known as _bug_ 2564 at http://mercurial.selenic.com/bts/issue2564