diff mercurial/commands.py @ 9537:460e410c39be

commands: simpler sort of help topic names
author Martin Geisler <mg@lazybytes.net>
date Sun, 04 Oct 2009 10:17:01 +0200
parents e2fd9b62349b
children cad36e496640
line wrap: on
line diff
--- 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))