[PATCH 1 of 1] blackblox extension to help with debugging

Nicolas Dumazet nicdumz at gmail.com
Mon Nov 15 19:23:25 CST 2010


2010/11/16 Matt Mackall <mpm at selenic.com>:
> On Sun, 2010-11-14 at 16:36 +0900, Nicolas Dumazet wrote:
>> # HG changeset patch
>> # User Nicolas Dumazet <nicdumz.commits at gmail.com>
>> # Date 1287388636 -32400
>> # Node ID 5f9627e140d751e8b8a5eee956f91da759ea2f0e
>> # Parent  df7c2f81afd534dd3f7b37ce6f584e0c5fc0b412
>> blackblox extension to help with debugging
>
> No sample output = nothing to discuss.

So far, it looks like that:

blackbox extension logs here hg events to help diagnosing errors.
You can truncate or delete this file, or include parts of the log
in bug reports on http://mercurial.selenic.com/bts/

Tue Nov 16 00:41:38 2010 +0000
 log
Tue Nov 16 00:41:38 2010 +0000
 add empty
 [1]
Tue Nov 16 00:41:38 2010 +0000
 log
 exthook: pre-log.foo: echo 'hook'
Tue Nov 16 00:41:38 2010 +0000
 incoming: push: c3cdbe7bbdc4 from file:/tmp/hgtests.8mVxWi/test-blackbox.t/foo
Tue Nov 16 00:41:38 2010 +0000
 diff -c notexisting
** Python 2.6.4 (r264:75706, Oct 29 2010, 08:25:21) [GCC 4.4.1]
** Mercurial Distributed SCM (version 1.7+45-5f9627e140d7)
** Extensions loaded: blackbox
Traceback (most recent call last):
  File "/tmp/hgtests.8mVxWi/install/lib/python/hgext/blackbox.py",
line 45, in runcommand
    ret = orig(lui, repo, cmd, fullargs, *args, **kwargs)
  File "/tmp/hgtests.8mVxWi/install/lib/python/mercurial/dispatch.py",
line 401, in runcommand
    ret = _runcommand(ui, options, cmd, d)
  File "/tmp/hgtests.8mVxWi/install/lib/python/mercurial/dispatch.py",
line 641, in _runcommand
    return checkargs()
  File "/tmp/hgtests.8mVxWi/install/lib/python/mercurial/dispatch.py",
line 595, in checkargs
    return cmdfunc()
  File "/tmp/hgtests.8mVxWi/install/lib/python/mercurial/dispatch.py",
line 588, in <lambda>
    d = lambda: util.checksignature(func)(ui, *args, **cmdoptions)
  File "/tmp/hgtests.8mVxWi/install/lib/python/mercurial/util.py",
line 427, in check
    return func(*args, **kwargs)
  File "/tmp/hgtests.8mVxWi/install/lib/python/mercurial/commands.py",
line 1505, in diff
    node2 = repo.lookup(change)
  File "/tmp/hgtests.8mVxWi/install/lib/python/mercurial/localrepo.py",
line 519, in lookup
    raise error.RepoLookupError(_("unknown revision '%s'") % key)
RepoLookupError: unknown revision 'notexisting'



STARTDATE
  command
  hooks? one hook by line
  [return code if non-zero]

The rationale: dates are interesting, to see what's related to the
current section. On the other hand, it's not necessary to have them
polluting the screen when grepping through logs, and in reality, we
only need the date for the start of the command.

So just log the time at the start, and output indented events for the
same command.

>
> --
> Mathematics is the supreme nostalgia of our time.
>
>
>



-- 
Nicolas Dumazet — NicDumZ


More information about the Mercurial-devel mailing list