changeset 34495:6d1b0970f80c

configitems: register the 'pager.attend' config
author Boris Feld <boris.feld@octobus.net>
date Fri, 30 Jun 2017 03:43:33 +0200
parents bbb5687e5140
children 18cd210535b3
files hgext/pager.py
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/pager.py	Fri Jun 30 03:43:46 2017 +0200
+++ b/hgext/pager.py	Fri Jun 30 03:43:33 2017 +0200
@@ -28,6 +28,7 @@
     commands,
     dispatch,
     extensions,
+    registrar,
     )
 
 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for
@@ -36,13 +37,20 @@
 # leave the attribute unspecified.
 testedwith = 'ships-with-hg-core'
 
+configtable = {}
+configitem = registrar.configitem(configtable)
+
+configitem('pager', 'attend',
+        default=lambda: attended,
+)
+
 def uisetup(ui):
 
     def pagecmd(orig, ui, options, cmd, cmdfunc):
         auto = options['pager'] == 'auto'
         if auto and not ui.pageractive:
             usepager = False
-            attend = ui.configlist('pager', 'attend', attended)
+            attend = ui.configlist('pager', 'attend')
             ignore = ui.configlist('pager', 'ignore')
             cmds, _ = cmdutil.findcmd(cmd, commands.table)