87 registrar.command.CATEGORY_MISC: 'Miscellaneous commands', |
87 registrar.command.CATEGORY_MISC: 'Miscellaneous commands', |
88 registrar.command.CATEGORY_NONE: 'Uncategorized commands', |
88 registrar.command.CATEGORY_NONE: 'Uncategorized commands', |
89 } |
89 } |
90 |
90 |
91 # Topic categories. |
91 # Topic categories. |
|
92 TOPIC_CATEGORY_IDS = 'ids' |
|
93 TOPIC_CATEGORY_OUTPUT = 'output' |
|
94 TOPIC_CATEGORY_CONFIG = 'config' |
|
95 TOPIC_CATEGORY_CONCEPTS = 'concepts' |
|
96 TOPIC_CATEGORY_MISC = 'misc' |
92 TOPIC_CATEGORY_NONE = 'none' |
97 TOPIC_CATEGORY_NONE = 'none' |
93 |
98 |
94 # The order in which topic categories will be displayed. |
99 # The order in which topic categories will be displayed. |
95 # Extensions with custom categories should insert them into this list |
100 # Extensions with custom categories should insert them into this list |
96 # after/before the appropriate item, rather than replacing the list or |
101 # after/before the appropriate item, rather than replacing the list or |
97 # assuming absolute positions. |
102 # assuming absolute positions. |
98 TOPIC_CATEGORY_ORDER = [ |
103 TOPIC_CATEGORY_ORDER = [ |
|
104 TOPIC_CATEGORY_IDS, |
|
105 TOPIC_CATEGORY_OUTPUT, |
|
106 TOPIC_CATEGORY_CONFIG, |
|
107 TOPIC_CATEGORY_CONCEPTS, |
|
108 TOPIC_CATEGORY_MISC, |
99 TOPIC_CATEGORY_NONE, |
109 TOPIC_CATEGORY_NONE, |
100 ] |
110 ] |
101 |
111 |
102 # Human-readable topic category names. These are translated. |
112 # Human-readable topic category names. These are translated. |
103 TOPIC_CATEGORY_NAMES = { |
113 TOPIC_CATEGORY_NAMES = { |
|
114 TOPIC_CATEGORY_IDS: 'Mercurial identifiers', |
|
115 TOPIC_CATEGORY_OUTPUT: 'Mercurial output', |
|
116 TOPIC_CATEGORY_CONFIG: 'Mercurial configuration', |
|
117 TOPIC_CATEGORY_CONCEPTS: 'Concepts', |
|
118 TOPIC_CATEGORY_MISC: 'Miscellaneous', |
|
119 TOPIC_CATEGORY_NONE: 'Uncategorized topics', |
104 TOPIC_CATEGORY_NONE: 'Uncategorized topics', |
120 TOPIC_CATEGORY_NONE: 'Uncategorized topics', |
105 } |
121 } |
106 |
122 |
107 def listexts(header, exts, indent=1, showdeprecated=False): |
123 def listexts(header, exts, indent=1, showdeprecated=False): |
108 '''return a text listing of the given extensions''' |
124 '''return a text listing of the given extensions''' |
291 lines.append(' :%s: %s\n' % (names[0], header)) |
307 lines.append(' :%s: %s\n' % (names[0], header)) |
292 |
308 |
293 return ''.join(lines) |
309 return ''.join(lines) |
294 |
310 |
295 helptable = sorted([ |
311 helptable = sorted([ |
296 (['bundlespec'], _("Bundle File Formats"), loaddoc('bundlespec')), |
312 (['bundlespec'], _("Bundle File Formats"), loaddoc('bundlespec'), |
297 (['color'], _("Colorizing Outputs"), loaddoc('color')), |
313 TOPIC_CATEGORY_CONCEPTS), |
298 (["config", "hgrc"], _("Configuration Files"), loaddoc('config')), |
314 (['color'], _("Colorizing Outputs"), loaddoc('color'), |
299 (['deprecated'], _("Deprecated Features"), loaddoc('deprecated')), |
315 TOPIC_CATEGORY_OUTPUT), |
300 (["dates"], _("Date Formats"), loaddoc('dates')), |
316 (["config", "hgrc"], _("Configuration Files"), loaddoc('config'), |
301 (["flags"], _("Command-line flags"), loaddoc('flags')), |
317 TOPIC_CATEGORY_CONFIG), |
302 (["patterns"], _("File Name Patterns"), loaddoc('patterns')), |
318 (['deprecated'], _("Deprecated Features"), loaddoc('deprecated'), |
|
319 TOPIC_CATEGORY_MISC), |
|
320 (["dates"], _("Date Formats"), loaddoc('dates'), TOPIC_CATEGORY_OUTPUT), |
|
321 (["flags"], _("Command-line flags"), loaddoc('flags'), |
|
322 TOPIC_CATEGORY_CONFIG), |
|
323 (["patterns"], _("File Name Patterns"), loaddoc('patterns'), |
|
324 TOPIC_CATEGORY_IDS), |
303 (['environment', 'env'], _('Environment Variables'), |
325 (['environment', 'env'], _('Environment Variables'), |
304 loaddoc('environment')), |
326 loaddoc('environment'), TOPIC_CATEGORY_CONFIG), |
305 (['revisions', 'revs', 'revsets', 'revset', 'multirevs', 'mrevs'], |
327 (['revisions', 'revs', 'revsets', 'revset', 'multirevs', 'mrevs'], |
306 _('Specifying Revisions'), loaddoc('revisions')), |
328 _('Specifying Revisions'), loaddoc('revisions'), TOPIC_CATEGORY_IDS), |
307 (['filesets', 'fileset'], _("Specifying File Sets"), loaddoc('filesets')), |
329 (['filesets', 'fileset'], _("Specifying File Sets"), loaddoc('filesets'), |
308 (['diffs'], _('Diff Formats'), loaddoc('diffs')), |
330 TOPIC_CATEGORY_IDS), |
|
331 (['diffs'], _('Diff Formats'), loaddoc('diffs'), TOPIC_CATEGORY_OUTPUT), |
309 (['merge-tools', 'mergetools', 'mergetool'], _('Merge Tools'), |
332 (['merge-tools', 'mergetools', 'mergetool'], _('Merge Tools'), |
310 loaddoc('merge-tools')), |
333 loaddoc('merge-tools'), TOPIC_CATEGORY_CONFIG), |
311 (['templating', 'templates', 'template', 'style'], _('Template Usage'), |
334 (['templating', 'templates', 'template', 'style'], _('Template Usage'), |
312 loaddoc('templates')), |
335 loaddoc('templates'), TOPIC_CATEGORY_OUTPUT), |
313 (['urls'], _('URL Paths'), loaddoc('urls')), |
336 (['urls'], _('URL Paths'), loaddoc('urls'), TOPIC_CATEGORY_IDS), |
314 (["extensions"], _("Using Additional Features"), extshelp), |
337 (["extensions"], _("Using Additional Features"), extshelp, |
315 (["subrepos", "subrepo"], _("Subrepositories"), loaddoc('subrepos')), |
338 TOPIC_CATEGORY_CONFIG), |
316 (["hgweb"], _("Configuring hgweb"), loaddoc('hgweb')), |
339 (["subrepos", "subrepo"], _("Subrepositories"), loaddoc('subrepos'), |
317 (["glossary"], _("Glossary"), loaddoc('glossary')), |
340 TOPIC_CATEGORY_CONCEPTS), |
|
341 (["hgweb"], _("Configuring hgweb"), loaddoc('hgweb'), |
|
342 TOPIC_CATEGORY_CONFIG), |
|
343 (["glossary"], _("Glossary"), loaddoc('glossary'), TOPIC_CATEGORY_CONCEPTS), |
318 (["hgignore", "ignore"], _("Syntax for Mercurial Ignore Files"), |
344 (["hgignore", "ignore"], _("Syntax for Mercurial Ignore Files"), |
319 loaddoc('hgignore')), |
345 loaddoc('hgignore'), TOPIC_CATEGORY_IDS), |
320 (["phases"], _("Working with Phases"), loaddoc('phases')), |
346 (["phases"], _("Working with Phases"), loaddoc('phases'), |
|
347 TOPIC_CATEGORY_CONCEPTS), |
321 (['scripting'], _('Using Mercurial from scripts and automation'), |
348 (['scripting'], _('Using Mercurial from scripts and automation'), |
322 loaddoc('scripting')), |
349 loaddoc('scripting'), TOPIC_CATEGORY_MISC), |
323 (['internals'], _("Technical implementation topics"), |
350 (['internals'], _("Technical implementation topics"), internalshelp, |
324 internalshelp), |
351 TOPIC_CATEGORY_MISC), |
325 (['pager'], _("Pager Support"), loaddoc('pager')), |
352 (['pager'], _("Pager Support"), loaddoc('pager'), TOPIC_CATEGORY_CONFIG), |
326 ]) |
353 ]) |
327 |
354 |
328 # Maps topics with sub-topics to a list of their sub-topics. |
355 # Maps topics with sub-topics to a list of their sub-topics. |
329 subtopics = { |
356 subtopics = { |
330 'internals': internalstable, |
357 'internals': internalstable, |