Show More
@@ -127,6 +127,21 b' def load(ui, name, path):' | |||||
127 | fn(loaded=True) |
|
127 | fn(loaded=True) | |
128 | return mod |
|
128 | return mod | |
129 |
|
129 | |||
|
130 | def _runuisetup(name, ui): | |||
|
131 | uisetup = getattr(_extensions[name], 'uisetup', None) | |||
|
132 | if uisetup: | |||
|
133 | uisetup(ui) | |||
|
134 | ||||
|
135 | def _runextsetup(name, ui): | |||
|
136 | extsetup = getattr(_extensions[name], 'extsetup', None) | |||
|
137 | if extsetup: | |||
|
138 | try: | |||
|
139 | extsetup(ui) | |||
|
140 | except TypeError: | |||
|
141 | if extsetup.func_code.co_argcount != 0: | |||
|
142 | raise | |||
|
143 | extsetup() # old extsetup with no ui argument | |||
|
144 | ||||
130 | def loadall(ui): |
|
145 | def loadall(ui): | |
131 | result = ui.configitems("extensions") |
|
146 | result = ui.configitems("extensions") | |
132 | newindex = len(_order) |
|
147 | newindex = len(_order) | |
@@ -148,19 +163,10 b' def loadall(ui):' | |||||
148 | ui.traceback() |
|
163 | ui.traceback() | |
149 |
|
164 | |||
150 | for name in _order[newindex:]: |
|
165 | for name in _order[newindex:]: | |
151 | uisetup = getattr(_extensions[name], 'uisetup', None) |
|
166 | _runuisetup(name, ui) | |
152 | if uisetup: |
|
|||
153 | uisetup(ui) |
|
|||
154 |
|
167 | |||
155 | for name in _order[newindex:]: |
|
168 | for name in _order[newindex:]: | |
156 | extsetup = getattr(_extensions[name], 'extsetup', None) |
|
169 | _runextsetup(name, ui) | |
157 | if extsetup: |
|
|||
158 | try: |
|
|||
159 | extsetup(ui) |
|
|||
160 | except TypeError: |
|
|||
161 | if extsetup.func_code.co_argcount != 0: |
|
|||
162 | raise |
|
|||
163 | extsetup() # old extsetup with no ui argument |
|
|||
164 |
|
170 | |||
165 | # Call aftercallbacks that were never met. |
|
171 | # Call aftercallbacks that were never met. | |
166 | for shortname in _aftercallbacks: |
|
172 | for shortname in _aftercallbacks: |
General Comments 0
You need to be logged in to leave comments.
Login now