changeset 16667:bdb7ae65c27c

extensions: don't suggest commands from deprecated extensions
author Martin Geisler <mg@lazybytes.net>
date Fri, 11 May 2012 14:00:51 +0200
parents b9bef21cd214
children f393d20fb2ba
files mercurial/extensions.py
diffstat 1 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/extensions.py	Fri May 11 04:33:33 2012 -0500
+++ b/mercurial/extensions.py	Fri May 11 14:00:51 2012 +0200
@@ -329,18 +329,19 @@
             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)