Skip to content
Snippets Groups Projects
Commit fcb517ff authored by Boris Feld's avatar Boris Feld
Browse files

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

(This get worse if --traceback is used).

To work around this, we move this extensions related debug message behind a
new flag 'devel.debug.extensions' and restore the previous output.

I'm not fully happy about using the 'devel' section for a flag that can be
used by legitimate users to debug extensions issues. However, it fits well
next to other `devel.devel.*` options and is mostly used by extensions author
anyway.

We might move it to another, more appropriate section in the future (using
alias).
parent d79f3afb
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment