extensions: don't suggest commands from deprecated extensions
authorMartin Geisler <mg@lazybytes.net>
Fri, 11 May 2012 14:00:51 +0200
changeset 16667 bdb7ae65c27c
parent 16666 b9bef21cd214
child 16668 f393d20fb2ba
extensions: don't suggest commands from deprecated extensions
mercurial/extensions.py
--- 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)