# HG changeset patch # User Martin von Zweigbergk # Date 2017-07-07 07:13:53 # Node ID 68b7ceda99d736a45e2e484a620bcb44c39b9294 # Parent 67b42e64194dc515889678c4c1b6b00b4200ac00 dispatch: fix typo suggestion for disabled extension If the matching command lives in an in-tree extension (which is all we scan for), and the user has disabled that extension with "extensions.=!", we were not finding it, because the path in _disabledextensions was the empty string. If the user had set "extensions.=!" it would work, so it seems like just a mistake that it didn't work. diff --git a/mercurial/extensions.py b/mercurial/extensions.py --- a/mercurial/extensions.py +++ b/mercurial/extensions.py @@ -494,7 +494,11 @@ def _disabledpaths(strip_init=False): if name in exts or name in _order or name == '__init__': continue exts[name] = path - exts.update(_disabledextensions) + for name, path in _disabledextensions.iteritems(): + # If no path was provided for a disabled extension (e.g. "color=!"), + # don't replace the path we already found by the scan above. + if path: + exts[name] = path return exts def _moduledoc(file): diff --git a/tests/test-help.t b/tests/test-help.t --- a/tests/test-help.t +++ b/tests/test-help.t @@ -680,7 +680,11 @@ Not enabled extension gets suggested Disabled extension gets suggested $ hg --config extensions.rebase=! rebase hg: unknown command 'rebase' - (did you mean one of rename, resolve?) + 'rebase' is provided by the following extension: + + rebase command to move sets of revisions to a different ancestor + + (use 'hg help extensions' for information on enabling extensions) [255] Make sure that we don't run afoul of the help system thinking that