Mercurial > hg-stable
comparison mercurial/extensions.py @ 4560:3daed3680554
extensions: fix lookup of hgext.foo modules
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Wed, 13 Jun 2007 13:15:53 -0500 |
parents | 9338be783398 |
children | 7de7a80e7422 |
comparison
equal
deleted
inserted
replaced
4559:eda59019dc69 | 4560:3daed3680554 |
---|---|
14 '''return module with given extension name''' | 14 '''return module with given extension name''' |
15 try: | 15 try: |
16 return _extensions[name] | 16 return _extensions[name] |
17 except KeyError: | 17 except KeyError: |
18 for k, v in _extensions.iteritems(): | 18 for k, v in _extensions.iteritems(): |
19 if k.endswith('.' + name) or k.endswith('/' + name) or v == name: | 19 if k.endswith('.' + name) or k.endswith('/' + name): |
20 return sys.modules[v] | 20 return v |
21 raise KeyError(name) | 21 raise KeyError(name) |
22 | 22 |
23 def load(ui, name, path): | 23 def load(ui, name, path): |
24 if name in _extensions: | 24 if name in _extensions: |
25 return | 25 return |