Show More
@@ -162,12 +162,18 b' def _exthook(ui, repo, name, cmd, args, ' | |||
|
162 | 162 | return r |
|
163 | 163 | |
|
164 | 164 | def _allhooks(ui): |
|
165 | """return a list of (hook-id, cmd) pairs sorted by priority""" | |
|
166 | hooks = _hookitems(ui) | |
|
167 | return [(k, v) for p, o, k, v in sorted(hooks.values())] | |
|
168 | ||
|
169 | def _hookitems(ui): | |
|
170 | """return all hooks items ready to be sorted""" | |
|
165 | 171 | hooks = {} |
|
166 | 172 | for name, cmd in ui.configitems('hooks'): |
|
167 | 173 | if not name.startswith('priority'): |
|
168 | 174 | priority = ui.configint('hooks', 'priority.%s' % name, 0) |
|
169 | 175 | hooks[name] = (-priority, len(hooks), name, cmd) |
|
170 | return [(k, v) for p, o, k, v in sorted(hooks.values())] | |
|
176 | return hooks | |
|
171 | 177 | |
|
172 | 178 | _redirect = False |
|
173 | 179 | def redirect(state): |
General Comments 0
You need to be logged in to leave comments.
Login now