[Bug 4095] New: running a command from an extension fails when there is an unloadable extension and --traceback is specified

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Mon Nov 11 19:06:22 CST 2013


http://bz.selenic.com/show_bug.cgi?id=4095

          Priority: normal
            Bug ID: 4095
                CC: mercurial-devel at selenic.com
          Assignee: bugzilla at selenic.com
           Summary: running a command from an extension fails when there
                    is an unloadable extension and --traceback is
                    specified
          Severity: bug
    Classification: Unclassified
                OS: Linux
          Reporter: simohe at besonet.ch
          Hardware: PC
            Status: UNCONFIRMED
           Version: 2.8
         Component: Mercurial
           Product: Mercurial

Created attachment 1748
  --> http://bz.selenic.com/attachment.cgi?id=1748&action=edit
Test file demonstrating failure with --traceback plus extensions

First as an example:

This command runs wrong (no-x does not exist)
  $ hg --traceback --config extensions.no-x= --config extensions.churn= churn
  *** failed to import extension no-x: No module named no-x
  Traceback (most recent call last):
  ...
  ...
  ImportError: No module named no-x
  Traceback (most recent call last):
  ...
  ...
  UnknownCommand: churn
  hg: unknown command 'strip'
  'churn' is provided by the following extension:

      churn         command to display statistics about repository history

  use "hg help extensions" for information on enabling extensions
  [255]

But it runs correct without --traceback
  $ hg --config extensions.no-x= --config extensions.churn= churn
  *** failed to import extension no-x: No module named no-x
  abort: no repository found in '/tmp/demo/for/bug' (.hg not found)!
  [255]

(And also with changed order:)
  $ hg --traceback --config extensions.churn= --config extensions.no-x= churn
  *** failed to import extension no-x: No module named no-x
  Traceback (most recent call last):
  ...
  ...
  ImportError: No module named no-x
  Traceback (most recent call last):
  ...
  ...
  RepoError: no repository found in '/tmp/demo/for/bug' (.hg not found)
  abort: no repository found in '/tmp/demo/for/bug' (.hg not found)!
  [255]

 $ hg --traceback --config extensions.msng= --config extensions.churn= help
extensions
does list churn as disabled extensions


Then in words:

There is a condition when a command from an extension can not run. When another
extension does not exist and the option --traceback is provided.

It does not matter wheather the extension is enabled on command line on in
hgrc.
It does not matter where the non existing extensions is enabled. (Maybe it can
also have another problem than not being found.)
But it seems to depend on the order of the two extensions. When the missing
extension is loaded later, the command can be run.
It does also not matter whether --traceback is in command line or configured as
ui.traceback=true.


The attached test file shows commands with the desired output, plus a comment 
when they currently fail. Some parts of the file can be merged into an existing
test when fixing (suggestions: test-extensions.t).

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list