From 7724ee63b3eadd35afba94ef3fb2ac664ad26fcb Mon Sep 17 00:00:00 2001 From: Martin Geisler Date: Fri, 11 May 2012 14:00:51 +0200 Subject: [PATCH] extensions: don't suggest commands from deprecated extensions --- mercurial/extensions.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/mercurial/extensions.py b/mercurial/extensions.py index ac5532dd9a..801165d521 100644 --- a/mercurial/extensions.py +++ b/mercurial/extensions.py @@ -329,18 +329,19 @@ def disabledcmd(ui, cmd, strict=False): cmd = aliases[0] return (cmd, name, mod) + ext = None # first, search for an extension with the same name as the command path = paths.pop(cmd, None) if path: ext = findcmd(cmd, cmd, path) - if ext: - return ext - - # otherwise, interrogate each extension until there's a match - for name, path in paths.iteritems(): - ext = findcmd(cmd, name, path) - if ext: - return ext + if not ext: + # otherwise, interrogate each extension until there's a match + for name, path in paths.iteritems(): + ext = findcmd(cmd, name, path) + if ext: + break + if ext and 'DEPRECATED' not in ext.__doc__: + return ext raise error.UnknownCommand(cmd)