Patchwork [06,of,13,config] configitems: register the 'notify.maxsubject' config

login
register
mail settings
Submitter Boris Feld
Date Aug. 11, 2017, 1:23 p.m.
Message ID <b1fdeb6a53df2ef2a999.1502457803@FB>
Download mbox | patch
Permalink /patch/22875/
State Accepted
Headers show

Comments

Boris Feld - Aug. 11, 2017, 1:23 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1498787004 -7200
#      Fri Jun 30 03:43:24 2017 +0200
# Node ID b1fdeb6a53df2ef2a999b44858c13aa55b2a01eb
# Parent  54e8106d6945392e46360bd285e4504f66b968be
# EXP-Topic config.register.notify
configitems: register the 'notify.maxsubject' config

Patch

diff -r 54e8106d6945 -r b1fdeb6a53df 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,