configitems: register the 'notify.maxsubject' config
authorBoris Feld <boris.feld@octobus.net>
Fri, 30 Jun 2017 03:43:24 +0200
changeset 33743 3d08f4810690
parent 33742 66860180b009
child 33744 b76dc3e6bf99
configitems: register the 'notify.maxsubject' config
hgext/notify.py
--- a/hgext/notify.py	Fri Jun 30 03:43:23 2017 +0200
+++ b/hgext/notify.py	Fri Jun 30 03:43:24 2017 +0200
@@ -173,6 +173,9 @@
 configitem('notify', 'maxdiff',
     default=300,
 )
+configitem('notify', 'maxsubject',
+    default=67,
+)
 
 # template for single changeset can include email headers.
 single_template = '''
@@ -336,7 +339,7 @@
             else:
                 s = ctx.description().lstrip().split('\n', 1)[0].rstrip()
                 subject = '%s: %s' % (self.root, s)
-        maxsubject = int(self.ui.config('notify', 'maxsubject', 67))
+        maxsubject = int(self.ui.config('notify', 'maxsubject'))
         if maxsubject:
             subject = util.ellipsis(subject, maxsubject)
         msg['Subject'] = mail.headencode(self.ui, subject,