changeset 13202:d83566f4453b stable

notify: use util.ellipsis() to truncate long subject
author Yuya Nishihara <yuya@tcha.org>
date Fri, 24 Dec 2010 01:17:18 +0900
parents 4d03707916d3
children aa72ff5abf5f
files hgext/notify.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/notify.py	Mon Dec 27 17:49:58 2010 +0100
+++ b/hgext/notify.py	Fri Dec 24 01:17:18 2010 +0900
@@ -215,8 +215,8 @@
                 s = ctx.description().lstrip().split('\n', 1)[0].rstrip()
                 subject = '%s: %s' % (self.root, s)
         maxsubject = int(self.ui.config('notify', 'maxsubject', 67))
-        if maxsubject and len(subject) > maxsubject:
-            subject = subject[:maxsubject - 3] + '...'
+        if maxsubject:
+            subject = util.ellipsis(subject, maxsubject)
         msg['Subject'] = mail.headencode(self.ui, subject,
                                          self.charsets, self.test)