cvsps: wrap cmp methods (deprecated) in functools.cmp_to_key
authorAugie Fackler <augie@google.com>
Fri, 27 Apr 2018 01:24:04 -0400
changeset 37886 fe148d7544a4
parent 37885 a38ac7ec8e03
child 37887 dd071b34e60b
cvsps: wrap cmp methods (deprecated) in functools.cmp_to_key Differential Revision: https://phab.mercurial-scm.org/D3484
hgext/convert/cvsps.py
--- a/hgext/convert/cvsps.py	Fri Apr 27 01:18:43 2018 -0400
+++ b/hgext/convert/cvsps.py	Fri Apr 27 01:24:04 2018 -0400
@@ -6,6 +6,7 @@
 # GNU General Public License version 2 or any later version.
 from __future__ import absolute_import
 
+import functools
 import os
 import re
 
@@ -653,7 +654,7 @@
         return 0
 
     for c in changesets:
-        c.entries.sort(entitycompare)
+        c.entries.sort(key=functools.cmp_to_key(entitycompare))
 
     # Sort changesets by date
 
@@ -706,7 +707,7 @@
             d = c(len(l.branchpoints), len(r.branchpoints))
         return d
 
-    changesets.sort(cscmp)
+    changesets.sort(key=functools.cmp_to_key(cscmp))
 
     # Collect tags