Mercurial > public > mercurial-scm > hg
comparison mercurial/extensions.py @ 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 | 9eca39a91964 |
comparison
equal
deleted
inserted
replaced
16666:b9bef21cd214 | 16667:bdb7ae65c27c |
---|---|
327 break | 327 break |
328 else: | 328 else: |
329 cmd = aliases[0] | 329 cmd = aliases[0] |
330 return (cmd, name, mod) | 330 return (cmd, name, mod) |
331 | 331 |
332 ext = None | |
332 # first, search for an extension with the same name as the command | 333 # first, search for an extension with the same name as the command |
333 path = paths.pop(cmd, None) | 334 path = paths.pop(cmd, None) |
334 if path: | 335 if path: |
335 ext = findcmd(cmd, cmd, path) | 336 ext = findcmd(cmd, cmd, path) |
336 if ext: | 337 if not ext: |
337 return ext | 338 # otherwise, interrogate each extension until there's a match |
338 | 339 for name, path in paths.iteritems(): |
339 # otherwise, interrogate each extension until there's a match | 340 ext = findcmd(cmd, name, path) |
340 for name, path in paths.iteritems(): | 341 if ext: |
341 ext = findcmd(cmd, name, path) | 342 break |
342 if ext: | 343 if ext and 'DEPRECATED' not in ext.__doc__: |
343 return ext | 344 return ext |
344 | 345 |
345 raise error.UnknownCommand(cmd) | 346 raise error.UnknownCommand(cmd) |
346 | 347 |
347 def enabled(): | 348 def enabled(): |
348 '''return a dict of {name: desc} of extensions''' | 349 '''return a dict of {name: desc} of extensions''' |