comparison mercurial/hgweb/webcommands.py @ 17322:7124f984dc8d stable

help: use the first topic name from helptable, not the longest alias This makes the 'additional help topics' list consistent with the output from keyword search (for instance subrepo/subrepos). The sorting by longest name was introduced in 3f6a4f1de43f. There might have been a good reason for it back then, but now it seems like a better idea to place the preferred name first in the list in helptable.
author Mads Kiilerich <mads@kiilerich.com>
date Wed, 01 Aug 2012 14:59:15 +0200
parents 7ac5800dbc8f
children 8243dd66e0e3 109a6a9dcca8
comparison
equal deleted inserted replaced
17321:f3fd9d6802b7 17322:7124f984dc8d
929 929
930 topicname = req.form.get('node', [None])[0] 930 topicname = req.form.get('node', [None])[0]
931 if not topicname: 931 if not topicname:
932 def topics(**map): 932 def topics(**map):
933 for entries, summary, _ in helpmod.helptable: 933 for entries, summary, _ in helpmod.helptable:
934 entries = sorted(entries, key=len) 934 yield {'topic': entries[0], 'summary': summary}
935 yield {'topic': entries[-1], 'summary': summary}
936 935
937 early, other = [], [] 936 early, other = [], []
938 primary = lambda s: s.split('|')[0] 937 primary = lambda s: s.split('|')[0]
939 for c, e in commands.table.iteritems(): 938 for c, e in commands.table.iteritems():
940 doc = _getdoc(e) 939 doc = _getdoc(e)