mercurial/help.py
changeset 48913 f254fc73d956
parent 48875 6000f5b25c9b
child 48923 428177ad70b0
equal deleted inserted replaced
48912:a0674e916fb6 48913:f254fc73d956
   123 
   123 
   124 def listexts(header, exts, indent=1, showdeprecated=False):
   124 def listexts(header, exts, indent=1, showdeprecated=False):
   125     '''return a text listing of the given extensions'''
   125     '''return a text listing of the given extensions'''
   126     rst = []
   126     rst = []
   127     if exts:
   127     if exts:
   128         for name, desc in sorted(pycompat.iteritems(exts)):
   128         for name, desc in sorted(exts.items()):
   129             if not showdeprecated and any(w in desc for w in _exclkeywords):
   129             if not showdeprecated and any(w in desc for w in _exclkeywords):
   130                 continue
   130                 continue
   131             rst.append(b'%s:%s: %s\n' % (b' ' * indent, name, desc))
   131             rst.append(b'%s:%s: %s\n' % (b' ' * indent, name, desc))
   132     if rst:
   132     if rst:
   133         rst.insert(0, b'\n%s\n\n' % header)
   133         rst.insert(0, b'\n%s\n\n' % header)
   278             or (callable(doc) and lowercontains(doc(ui)))
   278             or (callable(doc) and lowercontains(doc(ui)))
   279         ):
   279         ):
   280             name = names[0]
   280             name = names[0]
   281             if not filtertopic(ui, name):
   281             if not filtertopic(ui, name):
   282                 results[b'topics'].append((names[0], header))
   282                 results[b'topics'].append((names[0], header))
   283     for cmd, entry in pycompat.iteritems(commands.table):
   283     for cmd, entry in commands.table.items():
   284         if len(entry) == 3:
   284         if len(entry) == 3:
   285             summary = entry[2]
   285             summary = entry[2]
   286         else:
   286         else:
   287             summary = b''
   287             summary = b''
   288         # translate docs *before* searching there
   288         # translate docs *before* searching there
   662     cats = {}
   662     cats = {}
   663     # Command -> short description
   663     # Command -> short description
   664     h = {}
   664     h = {}
   665     # Command -> string showing synonyms
   665     # Command -> string showing synonyms
   666     syns = {}
   666     syns = {}
   667     for c, e in pycompat.iteritems(cmdtable):
   667     for c, e in cmdtable.items():
   668         fs = cmdutil.parsealiases(c)
   668         fs = cmdutil.parsealiases(c)
   669         f = fs[0]
   669         f = fs[0]
   670         syns[f] = fs
   670         syns[f] = fs
   671         func = e[0]
   671         func = e[0]
   672         if select and not select(f):
   672         if select and not select(f):