changeset 34745:0b46440b1b45

configitems: register the 'blackbox.maxfiles' config
author Boris Feld <boris.feld@octobus.net>
date Wed, 11 Oct 2017 22:51:23 +0200
parents 0a2ef612ad50
children 54fa3db5becf
files hgext/blackbox.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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))