configitems: register the 'win32text.warn' config
authorBoris Feld <boris.feld@octobus.net>
Fri, 30 Jun 2017 03:45:56 +0200
changeset 34185 f84358f75978
parent 34184 b5bbfe176004
child 34186 f7c9c5d8c7f4
configitems: register the 'win32text.warn' config
hgext/win32text.py
--- a/hgext/win32text.py	Fri Jun 30 03:43:17 2017 +0200
+++ b/hgext/win32text.py	Fri Jun 30 03:45:56 2017 +0200
@@ -49,6 +49,7 @@
     short,
 )
 from mercurial import (
+    registrar,
     util,
 )
 
@@ -58,6 +59,13 @@
 # leave the attribute unspecified.
 testedwith = 'ships-with-hg-core'
 
+configtable = {}
+configitem = registrar.configitem(configtable)
+
+configitem('win32text', 'warn',
+    default=True,
+)
+
 # regexp for single LF without CR preceding.
 re_single_lf = re.compile('(^|[^\r])\n', re.MULTILINE)
 
@@ -178,6 +186,6 @@
 
 def extsetup(ui):
     # deprecated config: win32text.warn
-    if ui.configbool('win32text', 'warn', True):
+    if ui.configbool('win32text', 'warn'):
         ui.warn(_("win32text is deprecated: "
                   "https://mercurial-scm.org/wiki/Win32TextExtension\n"))