##// END OF EJS Templates
extensions: raise when trying to find an extension that failed to load...
Idan Kamara -
r14415:c238b12a default
parent child Browse files
Show More
@@ -21,13 +21,17 b' def extensions():'
21
21
22 def find(name):
22 def find(name):
23 '''return module with given extension name'''
23 '''return module with given extension name'''
24 mod = None
24 try:
25 try:
25 return _extensions[name]
26 mod = _extensions[name]
26 except KeyError:
27 except KeyError:
27 for k, v in _extensions.iteritems():
28 for k, v in _extensions.iteritems():
28 if k.endswith('.' + name) or k.endswith('/' + name):
29 if k.endswith('.' + name) or k.endswith('/' + name):
29 return v
30 mod = v
31 break
32 if not mod:
30 raise KeyError(name)
33 raise KeyError(name)
34 return mod
31
35
32 def loadpath(path, module_name):
36 def loadpath(path, module_name):
33 module_name = module_name.replace('.', '_')
37 module_name = module_name.replace('.', '_')
@@ -99,9 +99,24 b' qrecord patch (mq not present)'
99 abort: 'mq' extension not loaded
99 abort: 'mq' extension not loaded
100 [255]
100 [255]
101
101
102 help (bad mq)
103
104 $ echo "mq=nonexistant" >> $HGRCPATH
105 $ hg help qrecord
106 *** failed to import extension mq from nonexistant: [Errno 2] No such file or directory
107 hg qrecord [OPTION]... PATCH [FILE]...
108
109 interactively record a new patch
110
111 See "hg help qnew" & "hg help record" for more information and usage.
112
113 use "hg -v help qrecord" to show global options
114
102 help (mq present)
115 help (mq present)
103
116
104 $ echo "mq=" >> $HGRCPATH
117 $ sed 's/mq=nonexistant/mq=/' $HGRCPATH > hgrc.tmp
118 $ mv hgrc.tmp $HGRCPATH
119
105 $ hg help qrecord
120 $ hg help qrecord
106 hg qrecord [OPTION]... PATCH [FILE]...
121 hg qrecord [OPTION]... PATCH [FILE]...
107
122
General Comments 0
You need to be logged in to leave comments. Login now