diff hgext/mq.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 894c5b4be275
children 2ebac2bf7ad5
line wrap: on
line diff
--- a/hgext/mq.py	Sun Jul 05 11:01:30 2009 +0200
+++ b/hgext/mq.py	Sun Jul 05 11:02:00 2009 +0200
@@ -1541,7 +1541,7 @@
                 raise util.Abort(_('option "-r" not valid when importing '
                                    'files'))
             rev = cmdutil.revrange(repo, rev)
-            rev.sort(lambda x, y: cmp(y, x))
+            rev.sort(reverse=True)
         if (len(files) > 1 or len(rev) > 1) and patchname:
             raise util.Abort(_('option "-n" not valid when importing multiple '
                                'patches'))
@@ -2334,7 +2334,7 @@
         if ui.verbose:
             guards['NONE'] = noguards
         guards = guards.items()
-        guards.sort(lambda a, b: cmp(a[0][1:], b[0][1:]))
+        guards.sort(key=lambda x: x[0][1:])
         if guards:
             ui.note(_('guards in series file:\n'))
             for guard, count in guards: