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

login
register
mail settings
Submitter phabricator
Date May 8, 2018, 1:36 p.m.
Message ID <differential-rev-PHID-DREV-zfjfajszzjv646symcuj-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/31362/
State Superseded
Headers show

Comments

phabricator - May 8, 2018, 1:36 p.m.
durin42 created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/convert/cvsps.py

CHANGE DETAILS




To: durin42, #hg-reviewers
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