Mercurial > hg
comparison mercurial/extensions.py @ 4582:7de7a80e7422
merge with main
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Thu, 14 Jun 2007 11:33:32 +0200 |
parents | b1716a8b32d3 3daed3680554 |
children | 669e76b7df24 |
comparison
equal
deleted
inserted
replaced
4581:4500fbe3a432 | 4582:7de7a80e7422 |
---|---|
15 '''return module with given extension name''' | 15 '''return module with given extension name''' |
16 try: | 16 try: |
17 return _extensions[name] | 17 return _extensions[name] |
18 except KeyError: | 18 except KeyError: |
19 for k, v in _extensions.iteritems(): | 19 for k, v in _extensions.iteritems(): |
20 if k.endswith('.' + name) or k.endswith('/' + name) or v == name: | 20 if k.endswith('.' + name) or k.endswith('/' + name): |
21 return sys.modules[v] | 21 return v |
22 raise KeyError(name) | 22 raise KeyError(name) |
23 | 23 |
24 def load(ui, name, path): | 24 def load(ui, name, path): |
25 if name in _extensions: | 25 if name in _extensions: |
26 return | 26 return |