--- a/hgext/blackbox.py Tue Mar 01 10:45:47 2016 +0000
+++ b/hgext/blackbox.py Thu Feb 11 19:38:26 2016 +0000
@@ -18,6 +18,8 @@
# dirty is *EXPENSIVE* (slow);
# each log entry indicates `+` if the repository is dirty, like :hg:`id`.
dirty = True
+ # record the source of log messages
+ logsource = True
[blackbox]
track = command, commandfinish, commandexception, exthook, pythonhook
@@ -174,9 +176,13 @@
any(ctx.sub(s).dirty() for s in ctx.substate)
)):
changed = '+'
+ if ui.configbool('blackbox', 'logsource', False):
+ src = ' [%s]' % event
+ else:
+ src = ''
try:
- ui._bbwrite('%s %s @%s%s (%s)> %s',
- date, user, rev, changed, pid, formattedmsg)
+ ui._bbwrite('%s %s @%s%s (%s)%s> %s',
+ date, user, rev, changed, pid, src, formattedmsg)
except IOError as err:
self.debug('warning: cannot write to blackbox.log: %s\n' %
err.strerror)