configitems: register the 'blackbox.maxfiles' config
authorBoris Feld <boris.feld@octobus.net>
Wed, 11 Oct 2017 22:51:23 +0200
changeset 34745 0b46440b1b45
parent 34744 0a2ef612ad50
child 34746 54fa3db5becf
configitems: register the 'blackbox.maxfiles' config
hgext/blackbox.py
--- a/hgext/blackbox.py	Sun Oct 15 00:43:01 2017 -0400
+++ b/hgext/blackbox.py	Wed Oct 11 22:51:23 2017 +0200
@@ -70,6 +70,9 @@
 configitem('blackbox', 'logsource',
     default=False,
 )
+configitem('blackbox', 'maxfiles',
+    default=7,
+)
 configitem('blackbox', 'track',
     default=lambda: ['*'],
 )
@@ -102,7 +105,7 @@
         else:
             if st.st_size >= maxsize:
                 path = vfs.join(name)
-                maxfiles = ui.configint('blackbox', 'maxfiles', 7)
+                maxfiles = ui.configint('blackbox', 'maxfiles')
                 for i in xrange(maxfiles - 1, 1, -1):
                     rotate(oldpath='%s.%d' % (path, i - 1),
                            newpath='%s.%d' % (path, i))