diff tests/test-blackbox.t @ 19066:2cad301a7f06

blackbox: automatically rotate log files If enabled, log rotation prevents the amount of space used by the blackbox log from growing without bound. This becomes important in cases where there are a lot of busy repositories managed by humans and automation on many machines. In large deployments, we cannot reasonably track all the repos where blackbox logs need to be managed, so it is safer to have blackbox manage its own logs than to move responsibility to an external tool such as logrotate. This change adds two configuration keys: * blackbox.maxsize is the maximum allowable size of the current log * blackbox.maxfiles is the number of log files to maintain
author Bryan O'Sullivan <bryano@fb.com>
date Thu, 18 Apr 2013 16:17:59 -0700
parents a7d0ddc7540b
children 63dda3c3bb11
line wrap: on
line diff
--- a/tests/test-blackbox.t	Thu Apr 18 12:58:28 2013 -0700
+++ b/tests/test-blackbox.t	Thu Apr 18 16:17:59 2013 -0700
@@ -131,5 +131,20 @@
   1970/01/01 00:00:00 bob> exthook-update: echo hooked finished in * seconds (glob)
   1970/01/01 00:00:00 bob> update exited False after * seconds (glob)
 
+log rotation
+
+  $ echo '[blackbox]' >> .hg/hgrc
+  $ echo 'maxsize = 20 b' >> .hg/hgrc
+  $ echo 'maxfiles = 3' >> .hg/hgrc
+  $ hg status
+  $ hg status
+  $ hg status
+  $ hg tip -q
+  2:d02f48003e62
+  $ ls .hg/blackbox.log*
+  .hg/blackbox.log
+  .hg/blackbox.log.1
+  .hg/blackbox.log.2
+
 cleanup
   $ cd ..