Commit Graph

14 Commits

Author SHA1 Message Date
Gregory Szorc
d620dd5f0f branchmap: log events related to branch cache
The blackblox log will now contain log events when the branch caches are
updated and written.
2014-03-22 17:14:37 -07:00
Gregory Szorc
0a33c75296 tags: log events related to tags cache
We now log when .hg/cache/tags data is built from scratch by reading
manifests and when the file is written.
2014-04-14 11:50:05 -07:00
Matt Mackall
280eec0087 tests: skip tests that require not having root (issue4089)
This adds a new root hghave to test against. Almost all of these are a
subset of unix-permissions, but that is also used for checking exec
bit handling.
2013-11-14 18:07:43 -06:00
Durham Goode
1e38cba77a blackbox: fix recording exit codes (issue3938)
Previously the blackbox wrapped runcommand, but this failed to see the error
codes that were created if an exception occurred. I moved that logging to now
wrap _runcatch, so it can observe and log the actual error code (such as when
a user ctrl+c's during a command).

Updated the tests as well. Tested the change by running all the tests with the
blackbox extension enabled and verifying nothing broke (aside from things that
printed what extensions were enabeld).

The progress tests are affected by calls to time.time() so they needed to be
updated to pass.
2013-05-22 17:31:47 -07:00
Durham Goode
0755816b12 blackbox: don't run permission tests on non-unix systems
The windows and vfat test runs were failing due to read/write permissions not
working the same on those systems.  On vfat, permissions can't be changed
at all, and on windows it seems the chmod emulation doesn't remove read
permissions.  We could theoretically get the 'cannot write to blacklog.log'
test to pass on windows but there's no #if condition to let us exclude vfat
only.

Verified that test-blackbox passes on windows now.
2013-04-22 18:00:59 -07:00
Bryan O'Sullivan
228c308a0d 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
2013-04-18 16:17:59 -07:00
Bryan O'Sullivan
0477147e50 blackbox: fix a few check-code portability errors 2013-03-27 09:00:43 -07:00
Bryan O'Sullivan
ec76ade165 blackbox: use util.getuser for portability
On Windows, our implementation is more robust than Python's version.
2013-03-20 13:40:06 -07:00
Bryan O'Sullivan
c6e69fe607 blackbox: prevent failed I/O from causing hg to abort
Instead, we simply print a warning message if opening the blackbox log
file fails, or if writing to it fails.
2013-03-20 13:40:05 -07:00
Durham Goode
3b156f49f8 blackbox: add backup bundle paths to blackbox logs
Writes the backup bundle paths to the blackbox so it's easy to see which
backup bundle is associated with which command when you are debugging an
issue.

Example output:

2013/03/13 10:39:56 durham> strip tip
2013/03/13 10:39:59 durham> saved backup bundle to /data/users/durham/www-hg/.hg/strip-backup/e5fac262363a-backup.hg
2013/03/13 10:40:03 durham> strip tip exited 0 after 7.97 seconds
2013-03-13 10:43:51 -07:00
Simon Heimberg
09ff06d669 tests: remove glob lines which unnecessary match / for \ on windows
This lines were reported as unnecessary when running the tests on windows
because the path was already printed with a slash and not a backslash.
2013-02-23 22:54:57 +01:00
Simon Heimberg
dfbcf00e3b tests: append glob to filename output when required for windows
The test failed on windows before this patch.
2013-02-23 22:07:38 +01:00
Durham Goode
e35379ebe6 blackbox: only show new heads on incoming
The blackbox was logging every head after every incoming group.
Now we only log the heads that have changed.

Added a test.  Moved the hooks test to the bottom of the file since
the hooks interfer with the tests after it.
2013-02-13 11:07:01 -08:00
Durham Goode
0ff852b84e blackbox: tests for the blackbox extension
A few tests to cover the blackbox extension. Covers commands, hooks, and
incoming changes.
2013-02-09 13:35:30 -08:00