Show More
@@ -194,13 +194,19 b' def commandprinter(ui, cmdtable, section' | |||||
194 | helpcategory = details[0].helpcategory |
|
194 | helpcategory = details[0].helpcategory | |
195 | return helpcategory or help.registrar.command.CATEGORY_NONE |
|
195 | return helpcategory or help.registrar.command.CATEGORY_NONE | |
196 |
|
196 | |||
|
197 | cmdsbycategory = {category: [] for category in help.CATEGORY_ORDER} | |||
|
198 | for cmd in cmds: | |||
|
199 | # If a command category wasn't registered, the command won't get | |||
|
200 | # rendered below, so we raise an AssertionError. | |||
|
201 | if helpcategory(cmd) not in cmdsbycategory: | |||
|
202 | raise AssertionError( | |||
|
203 | "The following command did not register its (category) in " | |||
|
204 | "help.CATEGORY_ORDER: %s (%s)" % (cmd, helpcategory(cmd))) | |||
|
205 | cmdsbycategory[helpcategory(cmd)].append(cmd) | |||
|
206 | ||||
197 | # Print the help for each command. We present the commands grouped by |
|
207 | # Print the help for each command. We present the commands grouped by | |
198 | # category, and we use help.CATEGORY_ORDER as a guide for a helpful order |
|
208 | # category, and we use help.CATEGORY_ORDER as a guide for a helpful order | |
199 | # in which to present the categories. |
|
209 | # in which to present the categories. | |
200 | cmdsbycategory = {category: [] for category in help.CATEGORY_ORDER} |
|
|||
201 | for cmd in cmds: |
|
|||
202 | cmdsbycategory[helpcategory(cmd)].append(cmd) |
|
|||
203 |
|
||||
204 | for category in help.CATEGORY_ORDER: |
|
210 | for category in help.CATEGORY_ORDER: | |
205 | categorycmds = cmdsbycategory[category] |
|
211 | categorycmds = cmdsbycategory[category] | |
206 | if not categorycmds: |
|
212 | if not categorycmds: | |
@@ -250,7 +256,6 b' def commandprinter(ui, cmdtable, section' | |||||
250 | if d[b'aliases']: |
|
256 | if d[b'aliases']: | |
251 | ui.write(_(b" aliases: %s\n\n") % b" ".join(d[b'aliases'])) |
|
257 | ui.write(_(b" aliases: %s\n\n") % b" ".join(d[b'aliases'])) | |
252 |
|
258 | |||
253 |
|
||||
254 | def allextensionnames(): |
|
259 | def allextensionnames(): | |
255 | return set(extensions.enabled().keys()) | set(extensions.disabled().keys()) |
|
260 | return set(extensions.enabled().keys()) | set(extensions.disabled().keys()) | |
256 |
|
261 |
General Comments 0
You need to be logged in to leave comments.
Login now