Patchwork [05,of,13,config] configitems: register the 'notify.maxdiff' config

login
register
mail settings
Submitter Boris Feld
Date Aug. 11, 2017, 1:23 p.m.
Message ID <54e8106d6945392e4636.1502457802@FB>
Download mbox | patch
Permalink /patch/22879/
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 1498787003 -7200
#      Fri Jun 30 03:43:23 2017 +0200
# Node ID 54e8106d6945392e46360bd285e4504f66b968be
# Parent  21153b5c2b932b7b481281664e087a9c1f6f7bbd
# EXP-Topic config.register.notify
configitems: register the 'notify.maxdiff' config

Patch

diff -r 21153b5c2b93 -r 54e8106d6945 hgext/notify.py
--- a/hgext/notify.py	Fri Jun 30 03:43:22 2017 +0200
+++ b/hgext/notify.py	Fri Jun 30 03:43:23 2017 +0200
@@ -170,6 +170,9 @@ 
 configitem('notify', 'fromauthor',
     default=None,
 )
+configitem('notify', 'maxdiff',
+    default=300,
+)
 
 # template for single changeset can include email headers.
 single_template = '''
@@ -367,7 +370,7 @@ 
 
     def diff(self, ctx, ref=None):
 
-        maxdiff = int(self.ui.config('notify', 'maxdiff', 300))
+        maxdiff = int(self.ui.config('notify', 'maxdiff'))
         prev = ctx.p1().node()
         if ref:
             ref = ref.node()