commands: simpler sort of help topic names
authorMartin Geisler <mg@lazybytes.net>
Sun, 04 Oct 2009 10:17:01 +0200
changeset 9537 460e410c39be
parent 9536 f04d17912441
child 9538 f96ee862aba0
commands: simpler sort of help topic names
mercurial/commands.py
--- a/mercurial/commands.py	Sat Oct 03 18:31:20 2009 +0200
+++ b/mercurial/commands.py	Sun Oct 04 10:17:01 2009 +0200
@@ -1619,9 +1619,7 @@
         ui.write(_("\nadditional help topics:\n\n"))
         topics = []
         for names, header, doc in help.helptable:
-            names = [(-len(name), name) for name in names]
-            names.sort()
-            topics.append((names[0][1], header))
+            topics.append((sorted(names, key=len, reverse=True)[0], header))
         topics_len = max([len(s[0]) for s in topics])
         for t, desc in topics:
             ui.write(" %-*s  %s\n" % (topics_len, t, desc))