comparison mercurial/extensions.py @ 5130:b3cc62268a91

Cache extension load failures. hg commands call extensions.loadall twice, once during dispatch and once when the repository is instantiated. Without this change, load caches successful loads, but not unsuccessful, causing errors to be displayed twice.
author Brendan Cully <brendan@kublai.com>
date Wed, 08 Aug 2007 18:04:06 -0700
parents 63b9d2deed48
children 3edd6fedc33a 1fd3248b8aa4
comparison
equal deleted inserted replaced
5128:86cd6fd61042 5130:b3cc62268a91
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
27 _extensions[shortname] = None
27 if path: 28 if path:
28 # the module will be loaded in sys.modules 29 # the module will be loaded in sys.modules
29 # choose an unique name so that it doesn't 30 # choose an unique name so that it doesn't
30 # conflicts with other modules 31 # conflicts with other modules
31 module_name = "hgext_%s" % name.replace('.', '_') 32 module_name = "hgext_%s" % name.replace('.', '_')