mercurial/help.py
changeset 40460 4fe63b573791
parent 40415 dce0e0f78f0f
parent 40421 e928bedf0919
child 40595 419d703115b0
equal deleted inserted replaced
40457:c2a0bc6412db 40460:4fe63b573791
     7 
     7 
     8 from __future__ import absolute_import
     8 from __future__ import absolute_import
     9 
     9 
    10 import itertools
    10 import itertools
    11 import os
    11 import os
       
    12 import re
    12 import textwrap
    13 import textwrap
    13 
    14 
    14 from .i18n import (
    15 from .i18n import (
    15     _,
    16     _,
    16     gettext,
    17     gettext,
    28     registrar,
    29     registrar,
    29     revset,
    30     revset,
    30     templatefilters,
    31     templatefilters,
    31     templatefuncs,
    32     templatefuncs,
    32     templatekw,
    33     templatekw,
       
    34     ui as uimod,
    33     util,
    35     util,
    34 )
    36 )
    35 from .hgweb import (
    37 from .hgweb import (
    36     webcommands,
    38     webcommands,
    37 )
    39 )
   429 addtopicsymbols('templates', '.. filtersmarker', templatefilters.filters)
   431 addtopicsymbols('templates', '.. filtersmarker', templatefilters.filters)
   430 addtopicsymbols('templates', '.. functionsmarker', templatefuncs.funcs)
   432 addtopicsymbols('templates', '.. functionsmarker', templatefuncs.funcs)
   431 addtopicsymbols('hgweb', '.. webcommandsmarker', webcommands.commands,
   433 addtopicsymbols('hgweb', '.. webcommandsmarker', webcommands.commands,
   432                 dedent=True)
   434                 dedent=True)
   433 
   435 
       
   436 def inserttweakrc(ui, topic, doc):
       
   437     marker = '.. tweakdefaultsmarker'
       
   438     repl = uimod.tweakrc
       
   439     def sub(m):
       
   440         lines = [m.group(1) + s for s in repl.splitlines()]
       
   441         return '\n'.join(lines)
       
   442     return re.sub(br'( *)%s' % re.escape(marker), sub, doc)
       
   443 
       
   444 addtopichook('config', inserttweakrc)
       
   445 
   434 def help_(ui, commands, name, unknowncmd=False, full=True, subtopic=None,
   446 def help_(ui, commands, name, unknowncmd=False, full=True, subtopic=None,
   435           **opts):
   447           **opts):
   436     '''
   448     '''
   437     Generate the help for 'name' as unformatted restructured text. If
   449     Generate the help for 'name' as unformatted restructured text. If
   438     'name' is None, describe the commands available.
   450     'name' is None, describe the commands available.