patch: fix sort() comparator argument
authorJim Hague <jim.hague@acm.org>
Sun, 25 Nov 2007 11:49:34 +0100
changeset 5547 777996744942
parent 5534 61c230f81068
child 5548 1fb38ef1f113
patch: fix sort() comparator argument 'hg import' fails under Python 2.3. The name of the compare function parameter in the call to list.sort() is 'cmpfunc' in Python 2.3 and 'cmp' in Python 2.4+. Passing the compare function as a named parameter is therefore problematic.
mercurial/patch.py
--- a/mercurial/patch.py	Tue Nov 20 14:31:58 2007 +0100
+++ b/mercurial/patch.py	Sun Nov 25 11:49:34 2007 +0100
@@ -357,7 +357,7 @@
 
         if len(cand) > 1:
             # resort our list of potentials forward then back.
-            cand.sort(cmp=sorter)
+            cand.sort(sorter)
         return cand
 
     def hashlines(self):