Patchwork [06,of,14] configitems: register the 'pager.attend' config

login
register
mail settings
Submitter Boris Feld
Date Oct. 6, 2017, 9:22 a.m.
Message ID <6d1b0970f80c55692f43.1507281742@FB>
Download mbox | patch
Permalink /patch/24585/
State Accepted
Headers show

Comments

Boris Feld - Oct. 6, 2017, 9:22 a.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1498787013 -7200
#      Fri Jun 30 03:43:33 2017 +0200
# Node ID 6d1b0970f80c55692f43d2b466f017f44f0ea441
# Parent  bbb5687e5140869ef504720317147dc229da1248
# EXP-Topic config.register.pager
# Available At https://bitbucket.org/octobus/mercurial-devel/
#              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r 6d1b0970f80c
configitems: register the 'pager.attend' config

Patch

diff -r bbb5687e5140 -r 6d1b0970f80c hgext/pager.py
--- 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)