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

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Tue May 8 14:23:25 EDT 2018


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

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
 



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


More information about the Mercurial-devel mailing list