configitems: register 'blackbox.maxsize' as an example of 'configbytes'
This exercise the default value handling in 'configbytes'.
--- a/hgext/blackbox.py Sat Jun 17 13:41:28 2017 +0200
+++ b/hgext/blackbox.py Sat Jun 17 13:21:06 2017 +0200
@@ -58,6 +58,13 @@
cmdtable = {}
command = registrar.command(cmdtable)
+configtable = {}
+configitem = registrar.configitem(configtable)
+
+configitem('blackbox', 'maxsize',
+ default=1048576,
+)
+
lastui = None
filehandles = {}
@@ -120,7 +127,7 @@
(newpath, oldpath, err.strerror))
fp = _openlog(self._bbvfs)
- maxsize = self.configbytes('blackbox', 'maxsize', 1048576)
+ maxsize = self.configbytes('blackbox', 'maxsize')
if maxsize > 0:
st = self._bbvfs.fstat(fp)
if st.st_size >= maxsize: