diff hgext/churn.py @ 9032:1fa80c5428b8

compat: use 'key' argument instead of 'cmp' when sorting a list
author Alejandro Santos <alejolp@alejolp.com>
date Sun, 05 Jul 2009 11:02:00 +0200
parents 9dda4c73fc3b
children feb3445e8b84
line wrap: on
line diff
--- a/hgext/churn.py	Sun Jul 05 11:01:30 2009 +0200
+++ b/hgext/churn.py	Sun Jul 05 11:02:00 2009 +0200
@@ -143,8 +143,8 @@
     if not rate:
         return
 
-    sortfn = ((not opts.get('sort')) and (lambda a, b: cmp(b[1], a[1])) or None)
-    rate.sort(sortfn)
+    sortkey = ((not opts.get('sort')) and (lambda x: -x[1]) or None)
+    rate.sort(key=sortkey)
 
     maxcount = float(max([v for k, v in rate]))
     maxname = max([len(k) for k, v in rate])