changeset 33769:3d08f4810690

configitems: register the 'notify.maxsubject' config
author Boris Feld <boris.feld@octobus.net>
date Fri, 30 Jun 2017 03:43:24 +0200
parents 66860180b009
children b76dc3e6bf99
files hgext/notify.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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,