Patchwork D3484: cvsps: wrap cmp methods (deprecated) in functools.cmp_to_key

login
register
mail settings
Submitter phabricator
Date May 8, 2018, 6:23 p.m.
Message ID <bf7f5ef89b1737b16634bbdfe35cbedb@localhost.localdomain>
Download mbox | patch
Permalink /patch/31391/
State Not Applicable
Headers show

Comments

phabricator - May 8, 2018, 6:23 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGfe148d7544a4: cvsps: wrap cmp methods (deprecated) in functools.cmp_to_key (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3484?vs=8536&id=8559

REVISION DETAIL
  https://phab.mercurial-scm.org/D3484

AFFECTED FILES
  hgext/convert/cvsps.py

CHANGE DETAILS




To: durin42, #hg-reviewers, indygreg
Cc: mercurial-devel

Patch

diff --git a/hgext/convert/cvsps.py b/hgext/convert/cvsps.py
--- a/hgext/convert/cvsps.py
+++ b/hgext/convert/cvsps.py
@@ -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