[PATCH] debug: move extensions debug behind a dedicated flag

Yuya Nishihara yuya at tcha.org
Tue Jul 17 07:54:00 EDT 2018


On Mon, 16 Jul 2018 10:14:08 -0700, Martin von Zweigbergk via Mercurial-devel wrote:
> On Mon, Jul 16, 2018 at 10:07 AM Boris FELD <boris.feld at octobus.net> wrote:
> 
> > On 16/07/2018 18:48, Martin von Zweigbergk via Mercurial-devel wrote:
> >
> >
> >
> > On Mon, Jul 16, 2018, 09:24 Boris Feld <boris.feld at octobus.net> wrote:
> >
> >> # HG changeset patch
> >> # User Boris Feld <boris.feld at octobus.net>
> >> # Date 1531756950 -7200
> >> #      Mon Jul 16 18:02:30 2018 +0200
> >> # Node ID ae4c03e746f6837692762fe488991b64008efd3e
> >> # Parent  3c569172848d329a81b1420d7cd8a5549b48f25f
> >> # EXP-Topic extdebug
> >> # Available At https://bitbucket.org/octobus/mercurial-devel/
> >> #              hg pull https://bitbucket.org/octobus/mercurial-devel/ -r
> >> ae4c03e746f6
> >> debug: move extensions debug behind a dedicated flag
> >>
> >> Since b86664c81833, we process the `--debug` flag earlier. This is overall
> >> good and useful, but has at least one negative side effect.
> >>
> >> Previously the debug message we report when trying to import extensions
> >> were
> >> issued before we processed the `--debug` flag. Now they happen after.
> >>
> >> Before:
> >>
> >>   $ ./hg id --debug
> >>   21f507b8de2f9c1606e9aeb5ec7d2a6dedb7a4a7 tip
> >>
> >> After:
> >>
> >>   $ ./hg id --debug                          ☿ (revset-bench)
> >>   could not import hgext.evolve (No module named evolve): trying
> >> hgext3rd.evolve
> >>   could not import hgext.mercurial_keyring (No module named
> >> mercurial_keyring): trying hgext3rd.mercurial_keyring
> >>   could not import hgext3rd.mercurial_keyring (No module named
> >> mercurial_keyring): trying mercurial_keyring
> >>   could not import hgext.hggit (No module named hggit): trying
> >> hgext3rd.hggit
> >>   could not import hgext3rd.hggit (No module named hggit): trying hggit
> >>   21f507b8de2f9c1606e9aeb5ec7d2a6dedb7a4a7 tip
> >>
> >
> > Isn't it about time we add a --full-node option? The --debug flag has no
> > backwards compatibility guarantee.
> >
> >
> > The --full-node is covered by templating. So I don't think we use anything
> > special regarding `hg id` here.
> >
> > The issue here is not about backward compatibility, but about usability.
> > The extra debug lines are very verbose and gets in the ways (especially
> > with traceback). I think they should be removed. `hg id` was only used an
> > example of a simple command with a small output.
> 
> I see. I think `hg id --debug` is actually somewhat frequently (there are
> at least 30 instances in our test cases), so I thought you wanted to
> preserve that behavior.

"hg log --debug" is another example of non-debug --debug option, which can't
be simply translated to a new flag. Hiding extension debug message seems
better.


More information about the Mercurial-devel mailing list