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

Matt Mackall mpm at selenic.com
Mon Nov 15 21:38:50 CST 2010


On Tue, 2010-11-16 at 10:23 +0900, Nicolas Dumazet wrote:
> 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/

Ok, need to point to BugTracker.

> Tue Nov 16 00:41:38 2010 +0000
>  log
> Tue Nov 16 00:41:38 2010 +0000
>  add empty
>  [1]

Seems a bit verbose. Perhaps:

Nov 16 00:41:38 2010 (0): log
Nov 16 00:41:38 2010 (1): add empty

> Tue Nov 16 00:41:38 2010 +0000
>  log
>  exthook: pre-log.foo: echo 'hook'

Nov 16 00:41:38 2010 (0): log
                          pre-log.foo: echo 'hook'

We probably want to log some/all of the environment vars.

And we might just want to put dates on every line with one event per
line. Because grepping logs is valuable.

> 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'

This is a traceback for an expected exception, yes? Not sure if we want
to log a whole traceback for that.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial-devel mailing list