hgext/churn.py
changeset 7076 c29d3f4ed967
parent 7070 2627ef59195d
child 7127 9df67ee30ef5
--- a/hgext/churn.py	Fri Oct 10 13:20:40 2008 +0200
+++ b/hgext/churn.py	Fri Oct 10 15:53:49 2008 +0300
@@ -153,11 +153,11 @@
     if not rate:
         return
 
-    keyfn = (not opts.get('sort')) and (lambda (k,v): (v,k)) or None
-    rate.sort(key=keyfn, reverse=not opts.get('sort'))
+    sortfn = ((not opts.get('sort')) and (lambda a, b: cmp(b[1], a[1])) or None)
+    rate.sort(sortfn)
 
-    maxcount = float(max(v for k, v in rate))
-    maxname = max(len(k) for k, v in rate)
+    maxcount = float(max([v for k, v in rate]))
+    maxname = max([len(k) for k, v in rate])
 
     ttywidth = get_tty_width()
     ui.debug(_("assuming %i character terminal\n") % ttywidth)